Re: [gdal-dev] get back a layer objet with ogr in python

2010-08-05 Thread Ludovic Granjon
Ok I understand Thanks it work perfectly Ludovic Le 05/08/2010 09:36, Francis Markham a écrit : The driver and datasource are going out of scope. The former can be fixed by using ogr.Open instead of driver.Open The latter can be fixed by returning it from the function. A revised version of y

Re: [gdal-dev] get back a layer objet with ogr in python

2010-08-05 Thread Francis Markham
The driver and datasource are going out of scope. The former can be fixed by using ogr.Open instead of driver.Open The latter can be fixed by returning it from the function. A revised version of your code would look like: # import modules from osgeo import ogr def openShapeLine(shapefile): #

[gdal-dev] get back a layer objet with ogr in python

2010-08-05 Thread Ludovic Granjon
Hello I'm trying to develop with ogr in python. I'm on ubuntu 10.4 and I use gdal 1.7 When I try to get back a layer object from a function, I have the following message when I do python monscript.py : "Erreur de segmentation" This is my code : --- # import modules from o