Re: [gdal-dev] unable to write a shapefile using ogr

2014-09-12 Thread Beau Taylor
Even Rouault Thanks, I got it. On Fri, Sep 12, 2014 at 5:18 PM, Even Rouault wrote: > Selon Beau Taylor : > > > I tried to insert the 'feature name', but could not. Can some one correct > > it? > > > > field_defn = ogr.FieldDefn("Name", ogr.OFTString) > > field_defn.SetWidth(32) > > There's a m

Re: [gdal-dev] unable to write a shapefile using ogr

2014-09-12 Thread Even Rouault
Selon Beau Taylor : > I tried to insert the 'feature name', but could not. Can some one correct > it? > > field_defn = ogr.FieldDefn("Name", ogr.OFTString) > field_defn.SetWidth(32) There's a missing call to : layer.CreateField(field_defn) and you should make sure to instanciate the feature *aft

Re: [gdal-dev] unable to write a shapefile using ogr

2014-09-11 Thread Beau Taylor
I tried to insert the 'feature name', but could not. Can some one correct it? field_defn = ogr.FieldDefn("Name", ogr.OFTString) field_defn.SetWidth(32) feature.SetField("Name", name) On Thu, Sep 11, 2014 at 6:33 AM, Jukka Rahkonen wrote: > Kyle Shannon pobox.com> writes: > > > > > Style is u

Re: [gdal-dev] unable to write a shapefile using ogr

2014-09-10 Thread Jukka Rahkonen
Kyle Shannon pobox.com> writes: > > Style is usually dictated by the application. You can set them in the > app, or for some formats/drivers you can use the OGR style API: > > http://gdal.org/ogr_feature_style.html > > AFAIK, shapefiles do not support styles As you said, style is dictated by

Re: [gdal-dev] unable to write a shapefile using ogr

2014-09-10 Thread Kyle Shannon
Beau, On Wed, Sep 10, 2014 at 7:30 AM, Beau Taylor wrote: > The following program successfully creates a shape file I am requiring. > > from osgeo import ogr > from osgeo import osr > > def myRing(coords): > ring = ogr.Geometry(ogr.wkbLinearRing) > for xy in coords: > ring.AddPoin

[gdal-dev] unable to write a shapefile using ogr

2014-09-10 Thread Beau Taylor
The following program successfully creates a shape file I am requiring. from osgeo import ogr from osgeo import osr def myRing(coords): ring = ogr.Geometry(ogr.wkbLinearRing) for xy in coords: ring.AddPoint(xy[0],xy[1]) return ring coords = [(-23.378906,68.974164), (-23.37890