[Geoserver-devel] GeoServer 2.2 beta1 - WFS 2.0 Axis Order

Hello everyone,

I created a layer “gmd_ex” (postgis as datasource). The internal preview in OpenLayers (WMS 1.1.0) looks fine.

SRS definition of source-layer (EPSG:31468) → using native SRS

PROJCS["DHDN / 3-degree Gauss-Kruger zone 4", 
  GEOGCS["DHDN", 
    DATUM["Deutsches Hauptdreiecksnetz", 
      SPHEROID["Bessel 1841", 6377397.155, 299.1528128, AUTHORITY["EPSG","7004"]], 
      TOWGS84[612.4, 77.0, 440.2, -0.054, 0.057, -2.797, 2.55], 
      AUTHORITY["EPSG","6314"]], 
    PRIMEM["Greenwich", 0.0, AUTHORITY["EPSG","8901"]], 
    UNIT["degree", 0.017453292519943295], 
    AXIS["Geodetic longitude", EAST], 
    AXIS["Geodetic latitude", NORTH], 
    AUTHORITY["EPSG","4314"]], 
  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], 
<b>  AXIS["Easting", EAST], 
  AXIS["Northing", NORTH], 
</b>  AUTHORITY["EPSG","31468"]]

The determined envelope also looks fine.

I tried several WFS 2.0 requests (stored queries):

http://www.weichand.de/2012/04/22/wfs-2-0-geoserver-beta-stored-queries-beispiele/

In the GetFeatureResponse (GML 3.2.1) the axis-order is inverted (Northing, Easting).

Also in the SHAPE-ZIP Output-Format:

PROJCS["DHDN / 3-degree Gauss-Kruger zone 4", 
  GEOGCS["DHDN", 
    DATUM["Deutsches Hauptdreiecksnetz", 
      SPHEROID["Bessel 1841", 6377397.155, 299.1528128, AUTHORITY["EPSG","7004"]], 
      TOWGS84[612.4, 77.0, 440.2, -0.054, 0.057, -2.797, 2.55], 
      AUTHORITY["EPSG","6314"]], 
    PRIMEM["Greenwich", 0.0, AUTHORITY["EPSG","8901"]], 
    UNIT["degree", 0.017453292519943295], 
    AXIS["Geodetic longitude", EAST], 
    AXIS["Geodetic latitude", NORTH], 
    AUTHORITY["EPSG","4314"]], 
  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], 
<b>  AXIS["Northing", NORTH], 
  AXIS["Easting", EAST], </b>
  AUTHORITY["EPSG","31468"]]

The shapefile is shown with the wrong axis-order in QGIS (using SRS:EPSG:31468).

Best regards

Jürgen

···

On Tue, Apr 24, 2012 at 10:42 AM, Jürgen Weichand <
juergen.weichand@anonymised.com> wrote:

**

Hello everyone,

I created a layer "gmd_ex" (postgis as datasource). The internal preview
in OpenLayers (WMS 1.1.0) looks fine.

SRS definition of source-layer (EPSG:31468) --> using native SRS

PROJCS["DHDN / 3-degree Gauss-Kruger zone 4",
  GEOGCS["DHDN",
    DATUM["Deutsches Hauptdreiecksnetz",
      SPHEROID["Bessel 1841", 6377397.155, 299.1528128, AUTHORITY["EPSG","7004"]],
      TOWGS84[612.4, 77.0, 440.2, -0.054, 0.057, -2.797, 2.55],
      AUTHORITY["EPSG","6314"]],
    PRIMEM["Greenwich", 0.0, AUTHORITY["EPSG","8901"]],
    UNIT["degree", 0.017453292519943295],
    AXIS["Geodetic longitude", EAST],
    AXIS["Geodetic latitude", NORTH],
    AUTHORITY["EPSG","4314"]],
  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["Easting", EAST],
  AXIS["Northing", NORTH], * AUTHORITY["EPSG","31468"]]

  The determined envelope also looks fine.

I tried several WFS 2.0 requests (stored queries):

http://www.weichand.de/2012/04/22/wfs-2-0-geoserver-beta-stored-queries-beispiele/

In these stored queries you are using the deprecated EPSG:XYWZ format,
which GeoServer
assumes to force lon/lat order, if you want the natural EPSG order you'll
have to use
the srs expression mandated by WFS 2.0, the urn:... format.

See this for a bit more details:
http://docs.geoserver.org/latest/en/user/services/wfs/basics.html#axis-ordering

Cheers
Andrea

--
-------------------------------------------------------
Ing. Andrea Aime
GeoSolutions S.A.S.
Tech lead

Via Poggio alle Viti 1187
55054 Massarosa (LU)
Italy

phone: +39 0584 962313
fax: +39 0584 962313
mob: +39 339 8844549

http://www.geo-solutions.it
http://geo-solutions.blogspot.com/
http://www.youtube.com/user/GeoSolutionsIT
http://www.linkedin.com/in/andreaaime
http://twitter.com/geowolf

-------------------------------------------------------

On Tue, Apr 24, 2012 at 11:13 AM, Andrea Aime
<andrea.aime@anonymised.com>wrote:

In these stored queries you are using the deprecated EPSG:XYWZ format,
which GeoServer
assumes to force lon/lat order, if you want the natural EPSG order you'll
have to use
the srs expression mandated by WFS 2.0, the urn:... format.

See this for a bit more details:

http://docs.geoserver.org/latest/en/user/services/wfs/basics.html#axis-ordering

Actually I see you using the expression only in the BBOX filter, but not
asking for an explicit
reprojection. Might be a bug, not sure.

Cheers
Andrea

--
-------------------------------------------------------
Ing. Andrea Aime
GeoSolutions S.A.S.
Tech lead

Via Poggio alle Viti 1187
55054 Massarosa (LU)
Italy

phone: +39 0584 962313
fax: +39 0584 962313
mob: +39 339 8844549

http://www.geo-solutions.it
http://geo-solutions.blogspot.com/
http://www.youtube.com/user/GeoSolutionsIT
http://www.linkedin.com/in/andreaaime
http://twitter.com/geowolf

-------------------------------------------------------

On 24/04/12 17:13, Andrea Aime wrote:

In these stored queries you are using the deprecated EPSG:XYWZ format,
which GeoServer
assumes to force lon/lat order, if you want the natural EPSG order
you'll have to use
the srs expression mandated by WFS 2.0, the urn:... format.
See this for a bit more details:
http://docs.geoserver.org/latest/en/user/services/wfs/basics.html#axis-ordering

Note that these are *not* the urn:ogc form mandated by WFS 2.0 but the transitional WFS 1.1(?) urn:x-ogc form implemented in GeoServer before urn:ogc was assigned to OGC by the IANA. GeoServer supports queries with the official srsName format, for example:

srsName=urn:ogc:def:crs:EPSG:4326

but be aware that while these requests are honoured, WFS responses are encoded with, for example:

srsName="urn:x-ogc:def:crs:EPSG:4326"

even for WFS 2.0.0. Some clients may not care.

See:

http://jira.codehaus.org/browse/GEOS-4545
http://jira.codehaus.org/browse/GEOT-3581
http://geoserver-devel.821594.n3.nabble.com/Geoserver-devel-srsName-urn-x-ogc-vs-urn-ogc-more-headaches-and-long-term-decisions-td1887641.html

Wow, OGC have been working overtime to annoy Andrea this week. :wink:

Kind regards,

--
Ben Caradoc-Davies <Ben.Caradoc-Davies@anonymised.com>
Software Engineer
CSIRO Earth Science and Resource Engineering
Australian Resources Research Centre