[gdal-dev] How to hide the GML in WFS

Even Rouault even.rouault at spatialys.com
Tue Jun 2 01:10:57 PDT 2015


Hi Jeremy,

> How do you hide the gml_id field from a WFS service? 

You couldn't. In the case of GML returned by a WFS service, the GML driver 
ignored the value of GML_EXPOSE_GML_ID. This was presumably to make WFS-T 
work, but seeing the code again, it should be robust (meaning not crash, but 
properly error out) if gml_id is hidden. So now fixed.

> ogrinfo --config GML_EXPOSE_GML_ID NO --config GML_EXPOSE_FID NO -al -so
> WFS:"https://data.linz.govt.nz/services;key=59f2aaa148bd4818994fa0d3ca36f7
> e1/wfs/layer-328?service=WFS&request=GetCapabilities" -nomd

Side remark: for faster execution (at least from my side of the Earth), if you 
just need the schema, you can also add -nocount -noextent. And no -ro to avoid 
an attempt in WFS-T.

> 
> Interestingly if I use the new GDAL 2.0 open options (ie. ogrinfo -oo
> GML_EXPOSE_GML_ID=NO -oo GML_EXPOSE_FID=NO). I get:
> 
> Warning 6: driver WFS does not support open option GML_EXPOSE_GML_ID
> Warning 6: driver WFS does not support open option GML_EXPOSE_FID

The open options were for the GML driver, not the WFS driver. And their name 
is without the GML_ prefix. The rationale for the open option name to be not 
prefixed is that we don't need the GML_ context anymore, open options being 
explicitely assigned to a particular dataset opening, whereas configuration 
options are global.

For consistency, I've also just added the EXPOSE_GML_ID open option to the WFS 
driver.

Even

-- 
Spatialys - Geospatial professional services
http://www.spatialys.com


More information about the gdal-dev mailing list