Ticket #2493 (closed defect: fixed)
GDAL thinks string field is an integer field in GML layer
|Reported by:||jbronn||Owned by:||chaitanya|
The attached GML file has features that have three fields, 'dbl', 'int', and 'str' that are of real, integer, and string types, respectively. The 'str' field is reported as being of integer type instead of being string type.
>>> from osgeo import ogr >>> ds = ogr.Open('test_point.gml') >>> lyr = ds >>> ldefn = lyr.GetLayerDefn() >>> [ldefn.GetFieldDefn(i).GetFieldTypeName(ldefn.GetFieldDefn(i).GetType()) for i in range(ldefn.GetFieldCount())] ['Real', 'Integer', 'Integer'] # Should be ['Real', 'Integer', 'String']
The GML file (and xsd) were generated from using ogr2ogr -F GML on an existing shapefile.