[gdal-dev] GML element/attribute discovery inconsistency

jratike80 jukka.rahkonen at maanmittauslaitos.fi
Tue Nov 27 03:57:01 PST 2018


Hi,

I would mention also an open option EMPTY_AS_NULL=NO that seems to adds some
fields into ogrinfo result:

gml_id: String (0.0) NOT NULL
a1: StringList (0.0)
a2: String (0.0)
a2_uom: String (1.0)
a3_title: String (5.0)
a3: String (0.0)
a3_href: String (22.0)
a4: String (0.0)
a4_href: String (40.0)
a5: String (0.0)
OGRFeature(MyFeaturetype1):785667386
  gml_id (String) = id.8685d1b8-a851-4034-b8ed-a4c785667386
  a1 (StringList) = (null)
  a2 (String) =
  a2_uom (String) = m
  a3_title (String) = title
  a3 (String) =
  a3_href (String) = https://test.com/value
  a4 (String) =
  a4_href (String) = #id.8685d1b8-a851-4034-b8ed-a4c785667386
  a5 (String) =

-Jukka Rahkonen-



 
Even Rouault-2 wrote
>> 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
> _______________________________________________
> gdal-dev mailing list

> gdal-dev at .osgeo

> https://lists.osgeo.org/mailman/listinfo/gdal-dev





--
Sent from: http://osgeo-org.1560.x6.nabble.com/GDAL-Dev-f3742093.html


More information about the gdal-dev mailing list