3

I installed:

  • gdal-110-1600-x64-core.msi
  • GDAL-1.10.0.win-amd64-py2.7.msi
  • gdal-110-1600-x64-filegdb.msi

from www.gisinternals.com

I can open my gdb on the command line:

C:\data>ogrinfo --version
GDAL 1.10.0, released 2013/04/24

C:\data>ogrinfo data.gdb
INFO: Open of `data.gdb'
  using driver `FileGDB' successful.

In "C:\Program Files\GDAL\gdalplugins" I have a file named ogr_FileGDB.dll

However, when I execute the following code:

os.environ['PATH'] = "C:\\Program Files\\GDAL" + ';' + os.environ['PATH']    
os.environ['GDAL_DRIVER_PATH'] = "C:\\Program Files\\GDAL\\gdalplugins"
os.environ['GDAL_DATA'] = "C:\\Program Files\\GDAL\\gdal-data"

print os.path.exists(os.environ['PATH'].split(';')[0])
print os.path.exists(os.environ['GDAL_DRIVER_PATH'])
print os.path.exists(os.environ['GDAL_DATA'])

driver = ogr.GetDriverByName('FileGDB')
print driver

I get the following output:

True
True
True
None

It looks like the FileGDB driver does not work with Python. Did I miss something to install?

Is it possible to print all available drivers of GDAL in Python?

p.s. A similar questions was asked already: "How to Open a File Geodatabase with ogr? [duplicate]". It was marked as duplicate to "How to access feature classes in file geodatabases with Python and GDAL?". However, I think there ogr.GetDriverByName('FileGDB') clearly works.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.