There is a geographic raster format and his name is MrSID. And there’s an ESRI vector format called the File Geodatabase (FileGDB). These are both proprietary, closed formats that don’t have native support within the most powerful open-source geospatial tools, GDAL and QGIS. To add support for these formats, I needed to compile GDAL with the right options. With support for these formats in GDAL, I was then able to get the data into QGIS or PostGIS without the need for ArcGIS to act as a converter.

This is how I did it with with Homebrew on OSX.

  1. Make sure Homebrew is up to date
    brew update
  • Install GDAL with these flags:

    brew install gdal --enable-unsupported --complete --with-postgres

    (I needed to use brew reinstall as I already had GDAL on my system)

  • Download the SDKs provided by LizardTech (MrSID creator), and ESRI that the GDAL plugins will use, in to this directory: /Library/Caches/Homebrew.

  • Get the GDAL plugin kegs for Homebrew from the OSGeo4Mac tap:

    brew tap dakcarto/osgeo4mac

    brew install gdal-mrsid

    brew install gdal-filegdb

  • Add this line to ~/.bash_profile and restart the session:

    export GDAL_DRIVER_PATH=/usr/local/lib/gdalplugins

  • Ensure everything is ok:

    • Being a raster format, do this for MrSID:

      gdalinfo --formats

      Look for:

      MrSID (rov): Multi-resolution Seamless Image Database (MrSID)
    • As a vector, check for FileGDB support with this:

      ogrinfo --formats

      Look for:
      _"FileGDB" (read/write)_

Success? Now I can…

  • Convert MrSID to GeoTIFF:
    gdal_translate -of GTiff input.sid output.tif

  • FileGDB to PostGIS:

    ogr2ogr -overwrite -skipfailures -f "PostgreSQL" PG:"host=myhost user=myuser dbname=mydb password=mypass" "/somefolder/BigFileGDB.gdb" "MyFeatureClass"
  • FileGDB to a shapefile (this will truncate field names to 10 characters, and field values to 255 characters)

    ogr2ogr -f "ESRI Shapefile" <out_directory> /path/to/your/database.gdb

Related awesome link: GDAL cheatsheet