On Mon, Feb 11, 2013 at 3:56 PM, Ákos Maróy <a...@maroy.hu> wrote:

>
> 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:
>
>
Nothing unrealistic about it, the google projection derives from
cylindrical mercator which
diverges at the poles, where the y coordinate becomes infinite.


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

Only if you limit yourself to 85 degrees if memory serves me well, which is
the north/south
limit in google/bing/yahoo maps.
Beyond that the deformation introduced by the projection is massive, and
the math really stops
to make any sense.

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
GeoTools-GT2-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users

Reply via email to