ESRI GDB Support in GDAL / ogr2ogr on Mac OS X 10.8

Well, self, I'm glad you asked (hopefully you won't have to spend a whole day figuring this out next time).

Steps

  1. Download the ESRI File Geodatabase API Library (requires account)
  2. Move the resultant FileGDB_API folder to /usr/local/
  3. Copy all the files from (or symlink for cleaner in/uninstall)
    • /usr/local/FileGDB_API/include/ ---> /usr/local/include
    • /usr/local/FileGDB_API/lib/ ---> /usr/local/lib
  4. Run brew install gdal --enable-unsupported
    • brew requires the invaluable homebrew package manager to be installed
    • I personally had to add --without-python to avoid issues with python support (numpy install issues)

Now, you should be able to, for example, convert fgdb files to better, more open formats by running

/usr/local/bin/ogr2ogr -f "GeoJSON" output_file.json input_file_gdb_folder

Why You Have to Manually Add FGDB Support

Support for ESRI's fgdb format can't be built into GDAL by default as it is a non-open source library. However, it can be added. Hence, the machinations above.

Inspiration

I found a few, disparate articles that really helped me put this all together into a cohesive piece

  • OGR Vector Formats
  • ESRI File GeoDatabase FileGDB
  • Installing GDAL/OGR with FileGDB support on OSX with Homebrew
  • Homebrew GDAL Formula (for install command options)