Building GDAL on Mac

From Wildsong
Jump to navigationJump to search

None of this is really "building" in the traditional sense so the page title is not accurate. "Getting GDAL and QGIS to work with ESRI FileGDB support" is an unwieldy title though. So be it.

Frameworks from Kyngchaos

1.11 "GDAL complete" package
1.11.4 GeoPDF plugin
1.3-64 FileGDB downloaded from ESRI, lib/* files installed in "/Library/Application Support/GDAL/1.11/Libraries/"
1.11.1-1 FileGDB plugin

I have not downloaded the other plugins yet. MrSID, ECW, Grass, etc..

The Framework plugins are separate from the plugins you see in QGIS. Plugins are dylib files that are installed in /Library/Application Support/GDAL/1.11/Plugins/ (by the pkg installers)

I also created modifications to my PATH so that I can run the commands from the command line. They look like this, in .bash_profile

# Kyngchaos packages
PATH=/Library/Frameworks/SQLite3.framework/Programs:$PATH
PATH=/Library/Frameworks/GEOS.framework/Programs:$PATH
PATH=/Library/Frameworks/UnixImageIO.framework/Programs:$PATH
PATH=/Library/Frameworks/PROJ.framework/Programs:$PATH
PATH=/Library/Frameworks/GDAL.framework/Programs:$PATH
export PATH

Homebrew

It is also possible to use the "homebrew" system on OS/X. I use the packages (above) because I could not figure out how to get QGIS to use the GDAL/FileGDB support from homebrew.

I followed suggestions found on this page: http://www.briantjacobs.com/mrsid-gdal-homebrew/

There are some less useful instructions here: https://trac.osgeo.org/gdal/wiki/BuildingOnMac

I downloaded the ESRI filegdb code, but did not bother with MrSID for now. I unzipped the filegdb zipfile into /Library/Caches/Homebrew/

brew uninstall --force proj
brew install proj
brew uninstall --force libgeotiff
brew uninstall --force gdal
brew install gdal --with-unsupported --with-complete --with-postgres
brew tap dakcarto/osgeo4mac
brew install gdal-filegdb
export GDAL_DRIVER_PATH=/usr/local/lib/gdalplugins
ogrinfo --formats | grep FileGDB

ogrinfo --formats|grep FileGDB
 -> "FileGDB" (read/write)
 -> "OpenFileGDB" (readonly)

Ta-da!