Skip to content

Instantly share code, notes, and snippets.

@gssxgss
Created July 12, 2017 09:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gssxgss/c8053d27d67d0589e638b639bf8c3336 to your computer and use it in GitHub Desktop.
Save gssxgss/c8053d27d67d0589e638b639bf8c3336 to your computer and use it in GitHub Desktop.
Install PostGIS on macOS
  1. install postgis
    $ brew install postgis
  2. start PostgreSQL service
    $ brew services start postgres
    stop PostgreSQL service
    $ brew services stop postgres
  3. create superuser
    $ createuser --superuser "$(echo $USER)"
    $ createdb "$(echo $USER)"
  4. install PostGIS extension in PostgreSQL
    1. login to postgresql commandline mode
      $ psql
    2. create postgis extension
      =# CREATE EXTENSION postgis;
    3. check postgis extension version
      =# \dx
      and you'll probably see a line as below:
      postgis  | 2.3.2   | public     | PostGIS geometry, geography, and raster spatial types and functions
      

That's all. Enjoy coding.

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