You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Extract the SDK, and put the contents of the directory in a known location, I used ~/local/filegdb. Here's an example path to one of the files: ~/local/filegdb/lib/libFileGDBAPI.dylib
I use ~/local/filegdb so it can stay isolated in it's own place, you can put it anywhere, but the next few steps might be different
Go into the directory containing the FileGDB SDK, e.g. ~/local/filegdb
ESRI built these dylib's using @rpath's, so to avoid needing to mess with DYLD_LIBRARY_PATH, I updated the @rpath's using install_name_tool
Here are the commands I used to patch the dylibs, this is not required if you want to use DYLD_LIBRARY_PATH yourself:
In the GDAL source root, run ./autogen.sh to re-create the configure script
Now run the configure script
./configure --with-fgdb=/Users/zacmcc/local/filegdb
The configure script has many options, here is the configure line I use for my custom build: https://gist.github.com/2005091, if you have other GDAL builds on your machine (e.g. homebrew) that you don't want to interfere with, I recommend at least using --prefix=~/local or some other place on your machine besides /usr/local (default for homebrew) or /opt/local (default for MacPorts).
If it worked properly, you should see in the output of configure indicating yes for FileGDB support
which ogr2ogr # make sure it's the correct ogr2ogr first
ogrinfo --formats # list out the formats
ogrinfo ~/Downloads/test_fgdb.gdb
#convert FileGDB directly to PostGIS
ogr2ogr -f "PostgreSQL" PG:"dbname='somedatabase' host='localhost' port='5432'" ~/Downloads/test_fgdb.gdb