[gdal-dev] field name in ESRI file
Eric Wolf
ebwolf at gmail.com
Wed Mar 24 11:15:26 EDT 2010
ESRI Shapefiles use the ancient DBF format for attribute data. DBFs
restricts the length of field names. When I have to work with Shapefiles, I
try to stick to 8-character field names and avoid spaces and special
characters.
-Eric
-=--=---=----=----=---=--=-=--=---=----=---=--=-=-
Eric B. Wolf New! 720-334-7734
USGS Geographer
Center of Excellence in GIScience
PhD Student
CU-Boulder - Geography
GPG Public Key: http://www.h4h.net/ebwolf.public.key.txt
On Wed, Mar 24, 2010 at 9:05 AM, Oz Nahum <nahumoz at gmail.com> wrote:
> Hello GDAL Devs,
>
> I encoutered a small problem, where I don't understand why field names in
> ESRI Shape files created by gdal, are truncated.
> Here is a code snippet:
>
> field_LUC = ogr.FieldDefn()
> field_LUC.SetName('LAND USE CODE')
> field_LUC.SetType(ogr.OFTInteger)
> field_LUC.SetWidth(15)
> dst_layer.CreateField(field_LUC)
>
>
> Yet, when I examine the output file the attribute table contains a field
> called "LAND USE C",
> so 3 characters are missing.
>
> Would be happy to know what am I doing wrong. Thank you very much,
>
> --
> Oz Nahum
> Graduate Student
> Zentrum für Angewandte Geologie
> Universität Tübingen
>
> ---
>
> Imagine there's no countries
> it isn't hard to do
> Nothing to kill or die for
> And no religion too
> Imagine all the people
> Living life in peace
>
>
>
> _______________________________________________
> gdal-dev mailing list
> gdal-dev at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/gdal-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/gdal-dev/attachments/20100324/4517bb87/attachment.html
More information about the gdal-dev
mailing list