[gdal-dev] StringList and Esri Shapefile

Even Rouault even.rouault at spatialys.com
Tue Oct 14 02:35:01 PDT 2014


On Tuesday 14 October 2014 11:28:19 Martin Landa wrote:
> Hi,
> 
> 2014-10-14 11:22 GMT+02:00 Paul Meems <bontepaarden at gmail.com>:
> > For ESRI shapefiles to max size of fieldnames is 10, so it is truncated.

Paul indeed identified the issue. If you use SetFrom(), it will not manage to 
match the target field names with the source ones, because CreateField() has 
done the field name truncation. ogr2ogr builds an integer map from the source 
field index to the target field index and uses SetFromWithMap(). You can have a 
look at swig/python/samples/ogr2ogr.py.
In the simple case (for drivers that don't have compulsory fields already 
created at layer creation), the map is the identity, i.e. panMap[i] = i with i 
from 0 to nFieldCount - 1.

> 
> I know. I am referring to something different - missing values.
> 
> Input:
> 
>   KmenoveCislo (Integer) = 162
> 
> Output (Esri Shapefile):
> 
>   KmenoveCis (Integer) = (null)
> 
> Martin

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


More information about the gdal-dev mailing list