Andrea Aime ha scritto:
> Martin Desruisseaux ha scritto:
>> Andrea Aime a écrit :
>>> Martin, if you give me some directions on how you'd like this to be
>>> handled I can do the grunt work and prepare some unit test
>> Logging warnings would be simplier than handling a hint. And thinking 
>> about that, a longitude (for example) outside the -180/+180° range is 
>> not necessary wrong, since 190° is equivalent to -170° and every 
>> trigonometric functions (sin, cos, etc.) used by map projections should 
>> still have correct mathematical behavior with those values. It is just 
>> that there is some chance that a out-of-range value is an user error, 
>> but not necessarly. And for some projection like Mercator, the threshold 
>> when we consider that a value is "out-of-range" is somewhat arbitrary - 
>> the case is really not as clear as the "missing bursa wolf parameters" 
>> case.
>>
>> For all those reasons, I'm more tempted by logging. In such case I 
>> suggest to add the following members in MapProjection:
>>
>> protected static final Logger LOGGER; (if not already there)
>>
>> protected (or private?) boolean verifyCoordinateRanges;
>>
>> maybe some convenience methods to be determined.
>>
>> And replace the exceptions by a warning logged only the first time it 
>> occurs for a given MapProjection instance. Because MapProjection are 
>> included in ProjectedCRS instances, and because the later are usually 
>> cached (when returned by CRS.decode(...)), in most case it will results 
>> in only one warning per EPSG code. Do you think it could be a reasonable 
>> compromise?
> 
> Sounds reasonable, but let me understand this better. Is 
> verifyCoordinateRanges used as a flag to determine whether the exception
> has been thrown once, so it's initialized as true, and then
> then changed to false the first time we log a warning?

Sorry, only noticed now the jira comment. So it's ok for me, do you want
me to cook up a patch, you review, I commit?
Cheers
Andrea

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Geotools-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-devel

Reply via email to