[gdal-dev] GDAL GML driver and .xsd schema mapping

Rahkonen Jukka Jukka.Rahkonen at mmmtike.fi
Mon Nov 14 04:21:35 EST 2011


It is not totally clear for me to what extent GDAL GML driver is utilising the .xsd schema if it is present.  I have an example where the schema obviously in not utilised or respected. In the schema the nationalCode element is defined as
          <element name="nationalCode" type="string">
              <documentation>-- Definition --&#13;
Thematic identifier corresponding to the national administrative codes defined in each country.&#13;

In the GML file the nationalCode attribute has values which are strings but they contain always only numeric characters. The .gfs file created by GDAL is interpreting the attribute data type as Integer.

Ogr2ogr conversion to other formats gives a correct data type for this attribute if I edit first manually the .gfs file to use String type for nationalCode. I would like to know if this is how it is planned to be and users just need to remember to correct all the strings-with-only-numeric-characters attribute types manually.

Perhaps this behaviour has something to do with the data which is using an Inspire schema that cannot be totally converted into ogr model?  Comments of ticket 4328 http://trac.osgeo.org/gdal/ticket/4328 especially  http://trac.osgeo.org/gdal/changeset/23315  seem to suggest so.

If that is a case, could it be possible to make ogr2ogr to print the message /* Too complex schema for us. Aborts parsing */  also on screen as a warning?  Otherwise users can believe that the .xsd schema file is used even it is not.

I am using the gdal-dev version from this morning (November 14) downloaded from gisinternals.

-Jukka Rahkonen-

More information about the gdal-dev mailing list