On 11/02/13 15:44, Andrea Aime wrote:
> 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.
>
unforunately this is not an option.

what I was thinking about is that when the transformations are made, and
the source is known to be within limits, then the result would be
explicitly limited not to exceed limits



another interesting thing I found is that when doing this conversion:

ReferencedEnvelope coverage = new ReferencedEnvelope(
                                  -179.9999, 179.9999, -89.9999, 89.9999,
                                  DefaultGeographicCRS.WGS84);
CoordinateRererenceSystem crs = CRS.decode("EPSG:900913");
ReferencedEnvelope re = coverage.transform(crs, false);


the result is:

ReferencedEnvelope[-2.0037497210840166E7 : 2.0037497210840166E7,
-8.898594657792848E7 : 8.89859465782924E7]


where the vertical extent is unrealistically large in both directions.
so much so, that when performing the following:

GeodeticCalculator gc = new GeodeticCalculator(crs);
gc.setStartingPosition(new DirectPosition2D(crs,
                                   re.getMinimum(0), re.getMinimum(1)));
gc.setDirection(0, mapBounds.getHeight());


one gets the following exception IllegalArgumentException:

The distance 177,971,893.156 is out of range (0 to 20,003,930.459 m)



indeed, shouldn't the above result be:

ReferencedEnvelope[-2.0037497210840166E7 : 2.0037497210840166E7,
-2.0037497210840166E7 : 2.0037497210840166E7]


instead?


Akos


------------------------------------------------------------------------------
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

Reply via email to