Skip to content

Instantly share code, notes, and snippets.

@joshuapowell
Last active March 11, 2023 18:37
Show Gist options
  • Star 17 You must be signed in to star a gist
  • Fork 3 You must be signed in to fork a gist
  • Save joshuapowell/e209a4dac5c8187ea8ce to your computer and use it in GitHub Desktop.
Save joshuapowell/e209a4dac5c8187ea8ce to your computer and use it in GitHub Desktop.
Setup Postgres.app to use PostGIS on OS X

Download and Install Postgres.app

Before we can setup PostGIS we need to have a local version of Postgresql installed and running. The most effecient way to do this is to download and install Postgres.app.

Spatially Enable your Postgres Database

Once Postgres.app is installed in your computers /Applications directory. Open the Terminal and enter the following two commands

psql -d DATABASE_NAME -f /Applications/Postgres.app/Contents/Versions/9.3/share/postgresql/contrib/postgis-2.1/postgis.sql

psql -d DATABASE_NAME -f /Applications/Postgres.app/Contents/Versions/9.3/share/postgresql/contrib/postgis-2.1/spatial_ref_sys.sql

Notes

Remember, this must be done on a database by database scale and this example does not accomodate multiple databases.

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