[gdal-dev] python filegdb problems

Stefano Iacovella stefano.iacovella at gmail.com
Tue Mar 20 17:04:25 EDT 2012


Did you run ogrinfo arc10geodb.gdb on a shell?

Does it show the layers inside the fileGDB or it throws some error?

Stefano


2012/3/20 Netherton, Kevin J FLNR:EX <Kevin.Netherton at gov.bc.ca>:
> Hello
>
> I’m trying to get the python bindings to the ogr library working with esri
> file geodatabase (filegdb) support.  I am using the latest version of ms4w
> package that includes gdal/ogr 1.9.
>
> I have created a esri file geodatabase driver, then from that created a data
> source, but am unable to access layers from the data source object.  Below
> is a quick summary of my code:
>
>     drvrObj = osgeo.ogr.GetDriverByName(r'FileGDB') # print the driver
> retunrs a SWIG object
>     path = str(r'C:\testdatadir\arc10geodb.gdb')
>     mydataSrc = drvrObj.Open(path) # printing the data source prints a SWIG
> object
>     lyrCnt = mydataSrc.GetLayerCount() # always returns 0 but there are many
> layers in the fgdb
>     lyr = mydataSrc.GetLayer(0) # always returns null
>
> The comments in the code above kind of summarize the situation.  It appears
> that I can create a valid datasource but am unable to read the layers inside
> the datasource.  Any ideas?
>
>
>
>
> _______________________________________________
> gdal-dev mailing list
> gdal-dev at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/gdal-dev


More information about the gdal-dev mailing list