[Qgis-developer] GML axis order handling using OGR Vector Driver

Jürgen Weichand Juergen at Weichand.de
Sat Jun 16 05:43:10 PDT 2012


Hello everyone,

The axis order in WFS 1.1 and WFS 2.0 is based on the input of the 
EPSG-Registry (http://www.epsg-registry.org). Please note that there may 
be different axis orders used by the reference systems.

Examples:
urn:ogc:def:crs:EPSG:4258 (ETRS 89) – Latitude, Longitude
http://geoserv.weichand.de:8080/geoserver/wfs?service=WFS&request=GetFeature&version=2.0.0&typeName=bvv:gmd_ex&count=1&srsName=urn:ogc:def:crs:EPSG:4258

urn:ogc:def:crs:EPSG:25832 (UTM 32 North) – Easting, Northing
http://geoserv.weichand.de:8080/geoserver/wfs?service=WFS&request=GetFeature&version=2.0.0&typeName=bvv:gmd_ex&count=1&srsName=urn:ogc:def:crs:EPSG:25832

urn:ogc:def:crs:EPSG:31468 (Gauß Krüger 4) – Northing, Easting
http://geoserv.weichand.de:8080/geoserver/wfs?service=WFS&request=GetFeature&version=2.0.0&typeName=bvv:gmd_ex&count=1&srsName=urn:ogc:def:crs:EPSG:31468

The OGR driver in QGIS is not able to detect the axis order, so the data 
will be handled wrong, if the axis order is Northing, Easting (or 
Latitude, Longitude). Is there a way to force the OGR driver to switch 
the axis order?

QgsVectorLayer(filename, title, "ogr") ?

The same problem exits if you loading GML files using “Add Vector 
Layer”. There should be a switch to set the axis order.



The QGIS WFS 2.0 Plugin (0.7) is currently using the following 
(unofficial?) convention:

Using the deprecated srsName-Style „EPSG:4326“ instead of 
„urn:ogc:def:crs:EPSG:4326“ will force the WFS Server to use Easting, 
Northing (Longitude, Latitude) axis order.

http://geoserv.weichand.de:8080/geoserver/wfs?service=WFS&request=GetFeature&version=2.0.0&typeName=bvv:gmd_ex&count=1&srsName=EPSG:4258
vs.
http://geoserv.weichand.de:8080/geoserver/wfs?service=WFS&request=GetFeature&version=2.0.0&typeName=bvv:gmd_ex&count=1&srsName=urn:ogc:def:crs:EPSG:4258

This convention is supported by GeoServer and deegree, but could fail 
with other server.
http://docs.geoserver.org/latest/en/user/services/wfs/basics.html#axis-ordering

Is there a better solution?

Best regards
Juergen Weichand

[Blog: http://www.weichand.de]



More information about the Qgis-developer mailing list