[postgis-devel] Fwd: [MetaCRS] Inf in projection results

Paul Ramsey pramsey at opengeo.org
Tue May 24 13:03:21 PDT 2011


---------- Forwarded message ----------
From: Martin Desruisseaux <martin.desruisseaux at geomatys.fr>
Date: Tue, May 24, 2011 at 11:34 AM
Subject: Re: [MetaCRS] Inf in projection results
To: metacrs at lists.osgeo.org


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

_______________________________________________
MetaCRS mailing list
MetaCRS at lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/metacrs



More information about the postgis-devel mailing list