[MetaCRS] Inf in projection results
Martin Desruisseaux
martin.desruisseaux at geomatys.fr
Tue May 24 14:34:29 EDT 2011
Le 24/05/11 19:36, Paul Ramsey a écrit :
> And following on with a non-projection-related query: if you as a
> geometry processing routine got handed a geometry with Inf
> coordinates, what would you do? Give up? Coerce them into something
> else?
I would suggest to keep the infinite values. IEEE arithmetic usually do the
right thing with infinities (x/Inf = 0 if x!=Inf, etc.), and Java Math functions
are properly defined (atan(Inf) = 90°, etc.).
In Geotoolkit.org, we have allowed Map Projection to returns infinite values
(e.g. 90°N in a Mercator projection = Infinity, and ensuring that the conversion
back to EPSG:4326 give 90°N). In my point of view this actually make the
handling of geometries easier. By removing as much special cases of the like "if
(x < threshold)" as possible (which were used in order to avoid divisions by
zero in the legacy GeoTools referencing code), users have reported that the
reprojections were smoother.
Regards,
Martin
More information about the MetaCRS
mailing list