Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save lklepner/abf18b35fafbd5d14869bc43b7f9abf6 to your computer and use it in GitHub Desktop.
Save lklepner/abf18b35fafbd5d14869bc43b7f9abf6 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/13/share/postgresql/contrib/postgis-3.1/postgis.sql

psql -d DATABASE_NAME -f /Applications/Postgres.app/Contents/Versions/13/share/postgresql/contrib/postgis-3.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