[gdal-dev] GML element/attribute discovery inconsistency

Even Rouault even.rouault at spatialys.com
Tue Nov 27 03:46:37 PST 2018


> Are my observations correct?

Björn,

It would be difficult to deny the results of tests :-)

The GML driver has a lot of particular handling tailored for particular 
datasets, which makes understanding its behaviour non-obvious

From the code (which confirms your observations),
- if an element has a xsi:nil attribute, then its other attributes are ignored 
and the content of the element is set to NULL (what you observe with a1)
- there is a particular case for the uom attribute, which is always reported 
even if GML_ATTRIBUTES_TO_OGR_FIELDS is not set (the _uom case was added 
before the generalization of GML_ATTRIBUTES_TO_OGR_FIELDS)
- empty elements (if empty for all features) are not reported as OGR fields

You may want to try the GMLAS driver for something that involves less 
guessing. The GML driver can work without any schema, and if the schema is 
present only supports simple constructs in it. Contrary to the GMLAS driver, 
which is (almost) completely schema driven to create the OGR layer and 
attribute structure:
https://www.gdal.org/drv_gmlas.html

Even

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


More information about the gdal-dev mailing list