Skip to content

Instantly share code, notes, and snippets.

@zismailov
Forked from srt32/install.md
Created September 4, 2018 12:00
Show Gist options
  • Save zismailov/f1f2896d6e6898c5c1d6bcac838ad03b to your computer and use it in GitHub Desktop.
Save zismailov/f1f2896d6e6898c5c1d6bcac838ad03b to your computer and use it in GitHub Desktop.
installing PostGIS on OSX

Installing the Postgres PostGIS extension on OSX

For reference: http://postgis.net/install

If you don’t already have PG installed

The most reliable way to get PostGIS on OSX is to download and install Postgres.app. Great for development and testing. Do not mix with other installations. Select the extension when prompted.

If you already have PG installed

You just need to add the extensions, Homebrew users can just run brew install postgis

  • Drop into your database

    psql oneblock_development

  • Run the following commands to add the extensions.

-- Enable PostGIS (includes raster)

$ CREATE EXTENSION postgis;

If you get:

ERROR:  58P01: could not open extension control file "/usr/local/Cellar/postgresql/9.3.4/share/postgresql/extension/postgis.control": No such file or directory

you probably don’t have the extension installed correctly.

-- Enable Topology

$ CREATE EXTENSION postgis_topology;

-- fuzzy matching needed for Tiger

$ CREATE EXTENSION fuzzystrmatch;

-- Enable US Tiger Geocoder

$ CREATE EXTENSION postgis_tiger_geocoder;

Confirm that it worked:

$ SELECT POSTGIS_FULL_VERSION();

You should see a message including postgis_full_version followed by a version number and some other info.

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