Tuesday 14 May 2019

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


How do you incorporate support for ESRI's fgdb format into GDAL / ogr2ogr on Mac OS X 10.8?



Answer



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




No comments:

Post a Comment

arcpy - Changing output name when exporting data driven pages to JPG?

Is there a way to save the output JPG, changing the output file name to the page name, instead of page number? I mean changing the script fo...