Skip to content

Instantly share code, notes, and snippets.

@ldlsegovia
Last active December 6, 2022 09:54
Show Gist options
  • Save ldlsegovia/3e9b5cba6038de528ee2 to your computer and use it in GitHub Desktop.
Save ldlsegovia/3e9b5cba6038de528ee2 to your computer and use it in GitHub Desktop.
Installing postgis 2.1.4 with previously installed postgres 9.3.2 on OS X 10.9
$ brew install geos proj gdal libxml2 json-c
$ wget http://download.osgeo.org/postgis/source/postgis-2.1.4.tar.gz
$ tar xvfz postgis-2.1.4.tar.gz
$ cd postgis-2.1.4
$ ./configure --with-projdir=path-to-proj --with-jsondir=path-to-json-c (example: ./configure --with-projdir=/opt/boxen/homebrew/Cellar/proj/4.8.0 --with-jsondir=/opt/boxen/homebrew/Cellar/json-c/0.11)
$ make
$ sudo make install
$ cd path-to-your-postgres-previously-installed/contrib/postgis-2-1 (example: cd /opt/boxen/homebrew/Cellar/postgresql/9.3.2-boxen/share/postgresql/contrib/postgis-2.1)
$ createdb template_postgis
$ createlang plpgsql template_postgis
# Run sql files:
$ psql -d template_postgis -f postgis.sql
$ psql -d template_postgis -f postgis_comments.sql
$ psql -d template_postgis -f spatial_ref_sys.sql
$ psql -d template_postgis -f rtpostgis.sql
$ psql -d template_postgis -f raster_comments.sql
$ psql -d template_postgis -f topology.sql
$ psql -d template_postgis -f topology_comments.sql
@stephen-a-ingram
Copy link

Hi, I found an alternative for the brew/wget install part was to do:

brew install geos proj gdal libxml2 json-c
brew reinstall postgis --build-from-source

Of course your version gets a specific postgis version! :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment