On Mon, Feb 11, 2013 at 2:59 PM, Ákos Maróy <[email protected]> wrote:
> Hi,
>
> I encountered an issue when transforming ReferencedEnvelopes between
> different CRSs, that because of the floating point operations, sometimes
> two transformations that should be an identity transform are having side
> effects.
>
> in short, if I have the following referenced envelope:
>
> ReferencedEnvelope coverage = new ReferencedEnvelope(
> -180, 180, -89.9999,
> 89.9999,
>
> DefaultGeographicCRS.WGS84);
>
> and then I have:
>
> CoordinateRererenceSystem crs = CRS.decode("EPSG:900913");
> ReferencedEnvelope re = coverage.transform(crs, false);
> ReferencedEnvelope rre = re.transform(DefaultGeographicCRS.WGS84, false);
>
>
> then, the values of 'rre' will be beyond Longitude.MAX_VALUE (it will be
> something like 180.000000003), and thus some operations will fail, as
> the coordinates are beyond the longitude limits.
>
> is there a way to make sure these transformation, which are based on
> valid starting data, end up producing valid data as well?
>
>
Is there a way to have float/double numbers get infinite precision? :-)
More seriously, the computation is already done with double, unless the
engine
is rewritten to use some extended class (like JTS DoubleDouble if memory
serves
me right) I have little hope that can be achieved.
Or, one could look at the math operations performend and see if that by
rearranging
them the transformation error goes down.
Cheers
Andrea
--
==
Our support, Your Success! Visit http://opensdi.geo-solutions.it for more
information.
==
Ing. Andrea Aime
@geowolf
Technical Lead
GeoSolutions S.A.S.
Via Poggio alle Viti 1187
55054 Massarosa (LU)
Italy
phone: +39 0584 962313
fax: +39 0584 1660272
mob: +39 339 8844549
http://www.geo-solutions.it
http://twitter.com/geosolutions_it
-------------------------------------------------------
------------------------------------------------------------------------------
Free Next-Gen Firewall Hardware Offer
Buy your Sophos next-gen firewall before the end March 2013
and get the hardware for free! Learn more.
http://p.sf.net/sfu/sophos-d2d-feb
_______________________________________________
GeoTools-GT2-Users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users