[Gdal-dev] Problem with Python, OGR/OGDI and VPF.

Eggert Jón Magnússon ejm at gavia.is
Thu Feb 19 05:09:59 EST 2004


Your script reproduces the problem on my end.

layer relline at rel(*)_line with 35 features.
gt 2
layer relpoint at rel(*)_point with 2 features.
gt 1

I am running on windows XP, and am using version 3.1.0 of ogdi (latest
binary release), and gdal 1.1.9.
I have not yet felt brave enough to compile ogdi for windows - but I am
getting there :)

regards,
Eggert

-----Original Message-----
From: gdal-dev-admin at remotesensing.org
[mailto:gdal-dev-admin at remotesensing.org]On Behalf Of Frank Warmerdam
Sent: 18. febrúar 2004 19:20
To: gdal-dev at remotesensing.org
Subject: Re: [Gdal-dev] Problem with Python, OGR/OGDI and
VPF.http://www.esri.com/devsupport/devconn/mapobjects/samples/vb/vpfsamp

les/vpfsamples.zip


Eggert Jón Magnússon wrote:
> 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.

Eggert,

I just tried the following script with the dataset you referenced, and it
seemed to work fine.

import ogr

file = ogr.Open( 'gltp:/vrf/dnc13cd/H1316010' )


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

It ran to completion, and seems to have reported all layers.  The report
ends with:

layer dqyarea at dqy(*)_area with 21 features.
gt 3
layer relline at rel(*)_line with 35 features.
gt 2
layer relpoint at rel(*)_point with 2 features.
gt 1
layer tileref at tileref(*)_area with 2 features.
gt 3
layer libref at libref(*)_line with 270 features.
gt 2

I was doing this on Linux with current CVS versions of OGDI and GDAL/OGR.
What platform are you working on?  What versions of GDAL and OGR?

Now that I am looking at the vrf driver again, I find there are some
leaks which I am digging into, but I can't imagine those would be
responsible for your problems.

Best regards,


---------------------------------------+------------------------------------
--
I set the clouds in motion - turn up   | Frank Warmerdam,
warmerdam at pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush    | Geospatial Programmer for Rent

_______________________________________________
Gdal-dev mailing list
Gdal-dev at remotesensing.org
http://remotesensing.org/mailman/listinfo/gdal-dev





More information about the Gdal-dev mailing list