[Gdal-dev] Problem with Python, OGR/OGDI and VPF.http://www.esri.com/devsupport/devconn/mapobjects/samples/vb/vpfsamples/vpfsamples.zip
Eggert Jón Magnússon
ejm at gavia.is
Wed Feb 18 06:35:22 EST 2004
I am having problems reading a VPF database through OGDI/OGR in python.
When I try to call ds.GetLayer(layerCount-2), something locks up.
I am not sure on which end the lockup is (whether OGR is waiting for OGDI?)
but ogrinfo displays the layer names correctly.
The dataset I am using is the formerly publically available sample VPF
dataset, San Diego Harbor. (I managed to obtain it from the ESRI homepage:
http://www.esri.com/devsupport/devconn/mapobjects/samples/vb/vpfsamples/vpfs
amples.zip)
Here is the snippet of code that manages to lock up:
for i in range(file.GetLayerCount()):
layer = file.GetLayer(i)
print 'layer %s with %d
features.'%(layer.GetName(),layer.GetFeatureCount())
gt = layer.GetLayerDefn().GetGeomType()
print 'gt',gt
if gt == 3:
obClass = Area
append = self.polygons.append
elif gt == 2:
obClass = Line
append = self.lines.append
else: # gt == 1: Point
obClass = None
continue
What happens is that I get a printout of all the layers except the last 2
ones, and the process locks up.
--
regards,
Eggert Jón Magnússon
More information about the Gdal-dev
mailing list