[Geoserver-users] reprojection behaviour

Hi list,

I noticed a strange behaviour during reprojection.
I have the same road layer in two projections SRS=EPSG:4121 and SRS=EPSG:4326 declared in the geoserver (1.5rc3) featureTypes.

When I issue the wms request, requesting both layers with SRS=EPSG:4121
http://localhost:8080/geoserver15rc3/wms?VERSION=1.1.1&REQUEST=GetMap&SERVICE=WMS&LAYERS=test:odiko_irakliou_wgs,test:odiko_irakliou&SRS=EPSG:4121&BBOX=24.7244495438998,34.93092781595529,25.54727688887454,35.41620008359657&WIDTH=1000&HEIGHT=1000&FORMAT=image/png&STYLES=&TRANSPARENT=TRUE&UNIQUEID=
the two layers are indentical fit.

But when i request with SRS=EPSG:4326
http://localhost:8080/geoserver15rc3/wms?VERSION=1.1.1&REQUEST=GetMap&SERVICE=WMS&LAYERS=test:odiko_irakliou_wgs,test:odiko_irakliou&SRS=EPSG:4326&BBOX=24.7244495438998,34.93092781595529,25.54727688887454,35.41620008359657&WIDTH=1000&HEIGHT=1000&FORMAT=image/png&STYLES=&TRANSPARENT=TRUE&UNIQUEID=
the two layers have an offeset

This mean that I can not have layers with different srs comabined ?
if yes how it worked in the 1rst request?

thx


×ñçóéìïðïéåßôå Yahoo!
ÂáñåèÞêáôå ôá åíï÷ëçôéêÜ ìçíý ìáôá (spam); Ôï Yahoo! Mail äéáèÝôåé ôçí êáëýôåñç äõíáôÞ ðñïóôáóßá êáôÜ ôùí åíï÷ëçôéêþí ìçíõìÜôùí
http://login.yahoo.com/config/mail?.intl=gr


×ñçóéìïðïéåßôå Yahoo!
ÂáñåèÞêáôå ôá åíï÷ëçôéêÜ ìçíý ìáôá (spam); Ôï Yahoo! Mail äéáèÝôåé ôçí êáëýôåñç äõíáôÞ ðñïóôáóßá êáôÜ ôùí åíï÷ëçôéêþí ìçíõìÜôùí
http://login.yahoo.com/config/mail?.intl=gr

gpio Oxxce ha scritto:

Hi list,

I noticed a strange behaviour during reprojection.
I have the same road layer in two projections SRS=EPSG:4121 and SRS=EPSG:4326 declared in the geoserver (1.5rc3) featureTypes.

How did you reproject the layer in the two CRS? Which software did you use?

When I issue the wms request, requesting both layers with SRS=EPSG:4121
http://localhost:8080/geoserver15rc3/wms?VERSION=1.1.1&REQUEST=GetMap&SERVICE=WMS&LAYERS=test:odiko_irakliou_wgs,test:odiko_irakliou&SRS=EPSG:4121&BBOX=24.7244495438998,34.93092781595529,25.54727688887454,35.41620008359657&WIDTH=1000&HEIGHT=1000&FORMAT=image/png&STYLES=&TRANSPARENT=TRUE&UNIQUEID=
the two layers are indentical fit.

But when i request with SRS=EPSG:4326
http://localhost:8080/geoserver15rc3/wms?VERSION=1.1.1&REQUEST=GetMap&SERVICE=WMS&LAYERS=test:odiko_irakliou_wgs,test:odiko_irakliou&SRS=EPSG:4326&BBOX=24.7244495438998,34.93092781595529,25.54727688887454,35.41620008359657&WIDTH=1000&HEIGHT=1000&FORMAT=image/png&STYLES=&TRANSPARENT=TRUE&UNIQUEID=
the two layers have an offeset

This mean that I can not have layers with different srs comabined ?
if yes how it worked in the 1rst request?

Hum, first request requires a 4326 -> 4121 reprojection,
the second requires a 4121 -> 4326 one.

I tried with the following little program:

public static void main(String args) throws Exception {
         CoordinateReferenceSystem wgs84 = CRS.decode("EPSG:4326", true);
         CoordinateReferenceSystem grs87 = CRS.decode("EPSG:4121", true);
         MathTransform toGrs87 = CRS.findMathTransform(wgs84, grs87, true);
         MathTransform toWgs84 = CRS.findMathTransform(grs87, wgs84, true);
         double p1 = new double {37, 23};
         double p2 = new double[2];
         double p3 = new double[2];
         toGrs87.transform(p1, 0, p2, 0, 1);
         toWgs84.transform(p2, 0, p3, 0, 1);
         System.out.println(p1[0] + ", " + p1[1]);
         System.out.println(p2[0] + ", " + p2[1]);
         System.out.println(p3[0] + ", " + p3[1]);
     }

37.0, 23.0
36.99824417914916, 22.997545719021677
37.000000002517446, 23.000000034611137

Yeah, there is a little difference, but looks like a floating point
arithmetic issue to me, which is to be expected (I may be wrong). Are you seeing bigger differences?

Cheers
Andrea