[Geoserver-users] different order of coordinates in WFS version 1.1.0/1.0.0

hi list,

working with GeoServer 1.6.1 I've noticed that the order of the X/Y coordinates is changing making a GetFeature Request by using different WFS versions 1.1.0 and 1.0.0 ?!
Is it a wanted behaviour ?

example :
<!-- Version 1.0.0

<wfs:FeatureCollection xsi:schemaLocation="http://www.opengis.net/wfs http://kataster1.sv.rostock.de:80/geoserver/schemas/wfs/1.0.0/WFS-basic.xsd http://geoportal.rostock.de/hro http://kataster1.sv.rostock.de:80/geoserver/wfs?service=WFS&version=1.0.0&request=DescribeFeatureType&typeName=hro:gemarkung&quot;&gt;
*
  <gml:boundedBy>
*
  <gml:Box srsName="http://www.opengis.net/gml/srs/epsg.xml#2398&quot;&gt;
<gml:coordinates decimal="." cs="," ts=" ">6001696.865,4508729.676 6004146,4510871.651</gml:coordinates>
</gml:Box>
</gml:boundedBy>
*
  <gml:featureMember>
*
  <hro:gemarkung fid="gemarkung.39523809">
<hro:gid>2</hro:gid>
. . . -->

<!-- Version 1.1.0

  <wfs:FeatureCollection xsi:schemaLocation="http://www.opengis.net/wfs http://kataster1.sv.rostock.de:80/geoserver/schemas/wfs/1.0.0/WFS-basic.xsd http://geoportal.rostock.de/hro http://kataster1.sv.rostock.de:80/geoserver/wfs?service=WFS&version=1.0.0&request=DescribeFeatureType&typeName=hro:gemarkung&quot;&gt;
*
  <gml:boundedBy>
*
  <gml:Box srsName="http://www.opengis.net/gml/srs/epsg.xml#2398&quot;&gt;
<gml:coordinates decimal="." cs="," ts=" ">4508729.5,6001696.5 4510872,6004146</gml:coordinates>
</gml:Box>
</gml:boundedBy>
*
  <gml:featureMember>
*
  <hro:gemarkung fid="gemarkung.39523809">
<hro:gid>2</hro:gid>
. . . -->

regards
Ronald

--
Ronald Woita
http://geoportal.rostock.de
Hansestadt Rostock
Kataster-, Vermessungs- und Liegenschaftsamt
Holbeinplatz 14, 18069 Rostock
email: ronald.woita@anonymised.com
phone: +49 (0)381 - 381 6256

Ronald Woita ha scritto:

hi list,

working with GeoServer 1.6.1 I've noticed that the order of the X/Y coordinates is changing making a GetFeature Request by using different WFS versions 1.1.0 and 1.0.0 ?!
Is it a wanted behaviour ?

Hum, it is mandated by OGC that in WFS 1.1.0 we respect the axis order of the authority, and this flips the coordinate order of all geographic
(longitude/latitude) reference systems, but 2398 is projected... ouch!
What a funny projection... I've just got the official EPSG wkt for
that projection, here it is:

PROJCS["Pulkovo 1942(83) / Gauss-Kruger zone 4",
   GEOGCS["Pulkovo 1942(83)",
     DATUM["Pulkovo 1942/83",
       SPHEROID["Krassowsky 1940", 6378245.0, 298.3, AUTHORITY["EPSG","7024"]],
       TOWGS84[24.0, -123.0, -94.0, 0.02, 0.25, 0.13, 0.226891286871806],
       AUTHORITY["EPSG","6178"]],
     PRIMEM["Greenwich", 0.0, AUTHORITY["EPSG","8901"]],
     UNIT["degree", 0.017453292519943295],
     AXIS["Geodetic latitude", NORTH],
     AXIS["Geodetic longitude", EAST],
     AUTHORITY["EPSG","4178"]],
   PROJECTION["Transverse Mercator", AUTHORITY["EPSG","9807"]],
   PARAMETER["central_meridian", 12.0],
   PARAMETER["latitude_of_origin", 0.0],
   PARAMETER["scale_factor", 1.0],
   PARAMETER["false_easting", 4500000.0],
   PARAMETER["false_northing", 0.0],
   UNIT["m", 1.0],
   AXIS["Northing", NORTH],
   AXIS["Easting", EAST],
   AUTHORITY["EPSG","2398"]]

(this is the official, the one you see in the GeoServer srsList
contains versions we forcefully flipped to always have easting/northing
orientation)

See? Apparently the official EPSG interpretation of that projection is
x = north, y = east.
So yes, this is expected behaviour unfortunately, with WFS 1.1 we're
forced to use whatever axis order the referencing authority asked for,
no matter how strange it seems.

There is a catch, the official way to name that srs in WFS 1.1 is
urn:x-ogc:def:crs:EPSG:6.11.2:2398, and we respect the authority
axis order only if none is provided in the request (since what I
typed before is the default in WFS 1.1, see the WFS capabilities
document) or if that form is explicitly used.
If your request specifies explicitly the srsName, you can force
the old axis order by using the the old way to name as srs, that
is, EPSG:2398. For example, in a GetFeature GET request you can
append ...&srsName=EPSG:2398, in a GetFeature POST you can
use <Query typeName="blah" srsName="EPSG:2398"> ...

More information on the axis order madness here:
http://geoserver.org/display/GEOSDOC/2.+WFS

Cheers
Andrea