[gdal-dev] Axes order issue in GML file

Even Rouault even.rouault at mines-paris.org
Fri Jan 31 01:27:13 PST 2014


Hi,

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.

Even

> Hi,
>
> 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:
> GEOGCS["ETRS89",
>     DATUM["European_Terrestrial_Reference_System_1989",
>         SPHEROID["GRS 1980",6378137,298.257222101,
>             AUTHORITY["EPSG","7019"]],
>         TOWGS84[0,0,0,0,0,0,0],
>         AUTHORITY["EPSG","6258"]],
>     PRIMEM["Greenwich",0,
>         AUTHORITY["EPSG","8901"]],
>     UNIT["degree",0.0174532925199433,
>         AUTHORITY["EPSG","9122"]],
>     AUTHORITY["EPSG","4258"]]
> ...
>
> (2) changes to srsName attribute value
>
> before: <gml:MultiSurface gml:id="BEW17S"
> srsName="http://www.opengis.net/gml/srs/epsg.xml#4258">
>   after: <gml:MultiSurface gml:id="BEW17S"
> srsName="urn:ogc:def:crs:EPSG::4258">
>
>
>
> --
> View this message in context:
>
http://osgeo-org.1560.x6.nabble.com/Axes-order-issue-in-GML-file-tp5101124.html
> Sent from the GDAL - Dev mailing list archive at Nabble.com.
> _______________________________________________
> gdal-dev mailing list
> gdal-dev at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/gdal-dev
>




More information about the gdal-dev mailing list