Hi,
I'm trying to fix an issue we have in GeoServer related to
map reprojection and... I've found a solution, but not sure
people will like it.

The issue is here:
http://jira.codehaus.org/browse/GEOS-1804

Basically, we have a client that is asking to render a map
in the Google projection, and using the following bbox:
-31308606.78125,-23481455.0859375,31308606.78125,23481455.0859375
which is way out of the 900913 bounds, which are:
-20037508.34,-20037508.34,20037508.34,20037508.34

Now, the renderer takes the bbox in the request and tries to
reproject it back in the native srs of the data, in this case, 4326,
and trips over a referencing exception, complaining that:

org.geotools.referencing.operation.projection.PointOutsideEnvelopeException: 
Longitude 281°15.0'W is out of range (±180°).
        at 
org.geotools.referencing.operation.projection.MapProjection$Inverse.transform(MapProjection.java:931)
        at 
org.geotools.referencing.operation.projection.MapProjection$Inverse.transform(MapProjection.java:973)
        at 
org.geotools.referencing.operation.transform.AbstractMathTransform.transform(AbstractMathTransform.java:217)
        at org.geotools.referencing.CRS.transform(CRS.java:983)
        at org.geotools.referencing.CRS.transform(CRS.java:1046)
        at 
org.geotools.geometry.jts.ReferencedEnvelope.transform(ReferencedEnvelope.java:465)

Now, that longitude is in fact way out of range, but most WMS
client do not have a knowledge of what the proper bounds are
for a projection. It seems to me that it would be better to turn
those exceptions into assertions, that is, make them trigger only
someone really asked for detailed sanity checks.

I tried to comment out line 930-937 of MapProjection, and as a result 
GeoServer is now able to render my map properly even when the bbox is
out of the valid area.

Opinions? A bit more leniency allows projection unaware clients to work 
better.

Cheers
Andrea


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Geotools-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-devel

Reply via email to