[gdal-dev] python/OGR error: interpreter crashes calling geometries method stored inside a python list

G. Allegri giohappy at gmail.com
Wed May 6 11:02:30 EDT 2009


I try to explain the problem. I need to setup a python list from a set
of geometries extrcted from a multipolygon layer.
I do the following (this is an excerpt, obviously):

source = ogr.Open(self.selectionshape)
layer = source.GetLayerByIndex(0)
geometries = []
features = [layer.GetFeature(i) for i in range(layer.GetFeatureCount())]
geometries = [features[i].GetGeometryRef() for i in range(len(features))]

When I call whatever Geometry methos, ie IsValid(), the python
interpreter crashes and exits. It doesn't happen if I call them
directly on the geometries (before including them inside the list), so
it seems related to the insertion inside the list.
Has anybody faced this before? Is it a bug or a problem with my code?

Thanks,
Giovanni


More information about the gdal-dev mailing list