4

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 driverFileGDB' 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.

Glorfindel
  • 1,096
  • 2
  • 9
  • 14
rbuffat
  • 143
  • 1
  • 7

0 Answers0