[gdal-dev] ogr2ogr with append fails to convert truncated fields

Tamas Szekeres szekerest at gmail.com
Fri Mar 1 11:57:43 PST 2013

2013/3/1 Even Rouault <even.rouault at mines-paris.org>

> There's even a 4th option that doesn't require any code change. Create a
> VRT file that renames the source fields to the truncated shapefile field
> names (or
> the reverse : creates a OGR VRT that renames the truncated shapefile field
> names
> to the original field names, since OGR VRT now supports since a few
> versions
> CreateFeature())

This may probably work, but doesn't seem to be very user friendly. Actually
I would prefer to include at least a flag to indicate that ogr2ogr should
provide mapping the fields in the same order (don't lookup field index by
name) for example:

ogr2ogr -append -f "ESRI Shapefile" -nofieldreorder destination.shp

or with the previous fieldmap approach

ogr2ogr -append -f "ESRI Shapefile" -fieldmap "default" destination.shp

Best regards,

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20130301/93c52fd1/attachment-0001.html>

More information about the gdal-dev mailing list