> drv_shp and shp_ds are going out of scope. Use
> ogr.Open, which will take care of all of this for you.
>
Thanks Howard
I am using now ogr.Open but there is still the same problem. Looks like I need
to reopen the layer in each method, as far as it seems it cannot exist the
layer without its datasource in the same context.
Or am I wrong?
this is my new code:
def getLayer2(shape_fullname):
ds = ogr.Open(shape_fullname, 0)
layer = ds.GetLayer(0)
print 'Name from method: %s' % layer.GetName()
return layer;
layer = getLayer2('output/myshape.shp')
print 'Name from main: %s' % layer.GetName()
still a segmentation fault in the second print statment
best regards
_______________________________________________
gdal-dev mailing list
[email protected]
http://lists.osgeo.org/mailman/listinfo/gdal-dev