[gdal-dev] Axes order issue in GML file
even.rouault at mines-paris.org
Fri Jan 31 01:27:13 PST 2014
The "CRS support" section of http://gdal.org/ogr/drv_gml.html should answer your
questions, but this is admitedly a highly confusing area.
Basically, when the GML driver sees a SRS as "EPSG:XXXX" (old way of expression
CRS in GML, consistant with WFS 1.0) (or
"http://www.opengis.net/gml/srs/epsg.xml#XXXX" also), it assumes that the
coordinate order is GIS friendly, i.e. longitude, latitude for geographic SRS.
And in the case of your sample, this is indeed the appropriate behaviour.
If the SRS in the GML is advertized as "urn:ogc:def:crs:EPSG:XXXX" (new way,
consistant with WFS 1.1 or above), then the GML driver will expect the
coordinates to be in the order specified by EPSG, i.e. latitude, longitude for
geographic SRS, and it will do the on-the-fly swapping to expose them as
longitude, latitude to be GIS friendly.
So that's a feature. If a GML file doesn't met those expectations, the above
described behaviour can be altered with the configuration options explained in
the GML driver doc.
> ogrinfo tells me that the SRS in my GML file (0) is EPSG:4258 and that its
> extent is somewhere around Belgium, see (1).
> However, as the coordinates for the features (that are indeed from Belgium)
> come in lon,lat (rather than lat,lon as defined by EPSG:4258): shouldn't the
> extent be reported as (49.496840, 2.543250) - (51.505070, 6.408180) and the
> features be (mis-)positioned somewhere near the Somalian coastline?
> If I change the srsName attribute value to another representation of
> EPSG:4258 (2), the mis-positioning happens, as expected.
> Can someone tell me if this is a feature or rather a limitation or a bug?
> Thanks in advance, Hermann
> (0) http://tinyurl.com/oqpzfck
> (1) ogrinfo -so -ro B_BE_2014-prelim.gml AQD_Zone
> Layer name: AQD_Zone
> Geometry: Multi Polygon
> Feature Count: 22
> Extent: (2.543250, 49.496840) - (6.408180, 51.505070)
> Layer SRS WKT:
> SPHEROID["GRS 1980",6378137,298.257222101,
> (2) changes to srsName attribute value
> before: <gml:MultiSurface gml:id="BEW17S"
> after: <gml:MultiSurface gml:id="BEW17S"
> View this message in context:
> Sent from the GDAL - Dev mailing list archive at Nabble.com.
> gdal-dev mailing list
> gdal-dev at lists.osgeo.org
More information about the gdal-dev