[gdal-dev] python filegdb problems

Netherton, Kevin J FLNR:EX Kevin.Netherton at gov.bc.ca
Tue Mar 20 14:57:29 EDT 2012


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?



-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/gdal-dev/attachments/20120320/bf5e8efd/attachment.html


More information about the gdal-dev mailing list