<div dir="ltr"><span style="font-family:arial,sans-serif;font-size:13px;font-weight:bold;white-space:nowrap">Even Rouault</span><br><div><span style="font-family:arial,sans-serif;font-size:13px;font-weight:bold;white-space:nowrap"><br></span></div><div><span style="font-family:arial,sans-serif;font-size:13px;font-weight:bold;white-space:nowrap">Thanks, I got it.</span></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Sep 12, 2014 at 5:18 PM, Even Rouault <span dir="ltr"><<a href="mailto:even.rouault@spatialys.com" target="_blank">even.rouault@spatialys.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Selon Beau Taylor <<a href="mailto:purelyamethyst@gmail.com">purelyamethyst@gmail.com</a>>:<br>
<span class=""><br>
> I tried to insert the 'feature name', but could not. Can some one correct<br>
> it?<br>
><br>
> field_defn = ogr.FieldDefn("Name", ogr.OFTString)<br>
> field_defn.SetWidth(32)<br>
<br>
</span>There's a missing call to :<br>
layer.CreateField(field_defn)<br>
<br>
and you should make sure to instanciate the feature *after* having added the<br>
field to the layer, otherwise crash is likely.<br>
<div class="HOEnZb"><div class="h5"><br>
<br>
> feature.SetField("Name", name)<br>
><br>
><br>
><br>
> On Thu, Sep 11, 2014 at 6:33 AM, Jukka Rahkonen <<a href="mailto:jukka.rahkonen@mmmtike.fi">jukka.rahkonen@mmmtike.fi</a>><br>
> wrote:<br>
><br>
> > Kyle Shannon <kyle <at> <a href="http://pobox.com" target="_blank">pobox.com</a>> writes:<br>
> ><br>
> > ><br>
> > > Style is usually dictated by the application. You can set them in the<br>
> > > app, or for some formats/drivers you can use the OGR style API:<br>
> > ><br>
> > > <a href="http://gdal.org/ogr_feature_style.html" target="_blank">http://gdal.org/ogr_feature_style.html</a><br>
> > ><br>
> > > AFAIK, shapefiles do not support styles<br>
> ><br>
> > As you said, style is dictated by application. If you create an "OGR_STYLE"<br>
> > column into shapefile and populate it with OGR feature style strings some<br>
> > programs can utilize them. I know that Mapserver can do it as well as GDAL<br>
> > when it writes PDF files.<br>
> ><br>
> > -Jukka Rahkonen-<br>
> ><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>
> ><br>
><br>
<br>
<br>
</div></div><span class="HOEnZb"><font color="#888888">--<br>
Spatialys - Geospatial professional services<br>
<a href="http://www.spatialys.com" target="_blank">http://www.spatialys.com</a><br>
</font></span></blockquote></div><br></div>