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.<div>
<br></div><div>-Eric</div><div><br clear="all">-=--=---=----=----=---=--=-=--=---=----=---=--=-=-<br>Eric B. Wolf New! 720-334-7734<br>USGS Geographer<br>Center of Excellence in GIScience<br>PhD Student <br>
CU-Boulder - Geography<br><br>GPG Public Key: <a href="http://www.h4h.net/ebwolf.public.key.txt">http://www.h4h.net/ebwolf.public.key.txt</a><br>
<br><br><div class="gmail_quote">On Wed, Mar 24, 2010 at 9:05 AM, Oz Nahum <span dir="ltr"><<a href="mailto:nahumoz@gmail.com">nahumoz@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div dir="ltr">Hello GDAL Devs, <br><br>I encoutered a small problem, where I don't understand why field names in ESRI Shape files created by gdal, are truncated. <br>Here is a code snippet:<br><br> field_LUC = ogr.FieldDefn() <br>
field_LUC.SetName('LAND USE CODE') <br> field_LUC.SetType(ogr.OFTInteger) <br> field_LUC.SetWidth(15) <br> dst_layer.CreateField(field_LUC)<br><br><br>Yet, when I examine the output file the attribute table contains a field called "LAND USE C", <br>
so 3 characters are missing. <br><br>Would be happy to know what am I doing wrong. Thank you very much, <br><br>-- <br>Oz Nahum<br>Graduate Student<br>Zentrum für Angewandte Geologie<br>Universität Tübingen<br><br>---<br>
<br>Imagine there's no countries<br>it isn't hard to do<br>Nothing to kill or die for<br>And no religion too<br>Imagine all the people<br>Living life in peace <br><br><br>
</div>
<br>_______________________________________________<br>
gdal-dev mailing list<br>
<a href="mailto:gdal-dev@lists.osgeo.org">gdal-dev@lists.osgeo.org</a><br>
<a href="http://lists.osgeo.org/mailman/listinfo/gdal-dev" target="_blank">http://lists.osgeo.org/mailman/listinfo/gdal-dev</a><br></blockquote></div><br></div>