[gdal-dev] OGR and WFS axis order

Even Rouault even.rouault at mines-paris.org
Fri Jan 31 10:39:09 PST 2014


Le vendredi 31 janvier 2014 18:09:57, Yves Jacolin (Free) a écrit :
> Hello Even,
> 
> Le vendredi 31 janvier 2014 11:38:07 Even Rouault a écrit :
> > Hi Yves,
> > 
> > > Hello,
> > > 
> > > I am testing ogr2ogr to read WFS services and create shapefil. WFS
> > > version 1.0.0 is working as expected but 1.1.0 send data with y/x axis
> > > and store them in shapefile without taking this in account. Points are
> > > reversed in QGIS.
> > 
> > Hum, the GML driver should do the swapping back to x/y axis
> > automatically, but sometimes the content of the GML isn't consistant
> > with the assumptions of the GML driver (see my email from one hour ago
> > related to that !)
> 
> I find it and read it, but I need to read it again :)
> 
> > > The OGR GML page gives some point about this and indicates two
> > > parameters: * configuration option GML_CONSIDER_EPSG_AS_URN to YES
> > > * configuration option GML_INVERT_AXIS_ORDER_IF_LAT_LONG to NO
> > > 
> > > Does it work with WFS format?
> > 
> > Yes. Your problem might be (blind guessing !!!) a WFS server that reports
> > the SRS as "EPSG:XXXX" with y/x axis. In that case, setting
> > GML_CONSIDER_EPSG_AS_URN to YES should help.
> 
> The WFS server is MapServer and my local test works correctly but not the
> server. I guess some difference but I don't know why or which. Does it
> seems possible to you that the EPSG database is not up tu date and can be
> the reason of this difference?

MapServer in WFS 1.1 returns lat,long order for geographic SRS and advertize 
SRS with "EPSG:XXXX" syntax, which confuses the OGR GML driver by default. 
MapServer should rather advertize "urn:ogc:def:crs:EPSG:XXXX" syntax for less 
ambiguity. This is something it does now in WFS 2.0 (in mapserver master) by 
default. And with mapserver master, you can also configure WFS 1.1 to emit 
"urn:ogc:def:crs:EPSG:XXXX" syntax by adding the "wfs_return_srs_as_urn" web
metadata item set to "true".

> 
> > > Which kind of configuration option is it? layer
> > > or dataset configuration option?
> > 
> > Configuration options can be passed with the "--config key value" (no
> > equal sign) on GDAL/OGR command line utilities. Or they can be set as
> > key=value environment variables.
> 
> Indeed, it works much better in this way :)
> 
> Thanks,
> 
> Y.
> 
> > > I didn't find a way to manage this. Thanks for any hint!
> > > 
> > > Y.
> > > 
> > > 
> > > 
> > > 
> > > _______________________________________________
> > > gdal-dev mailing list
> > > gdal-dev at lists.osgeo.org
> > > http://lists.osgeo.org/mailman/listinfo/gdal-dev

-- 
Geospatial professional services
http://even.rouault.free.fr/services.html


More information about the gdal-dev mailing list