Skip to content

Instantly share code, notes, and snippets.

@woudsma
Last active October 11, 2017 09:12
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 woudsma/07e43d4e375d642ca387dc5a740c3138 to your computer and use it in GitHub Desktop.
Save woudsma/07e43d4e375d642ca387dc5a740c3138 to your computer and use it in GitHub Desktop.

Install Homebrew

  • xcode-select --install
  • /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

Install PostgreSQL + PostGIS

  • brew update
  • brew install postgres
  • brew install postgis
  • brew services start postgres
  • createdb paperstorm
  • psql
    Inside psql:
  • create extension postgis;
  • \q (to quit psql)

Import database

Unzip 'paperstorm.dump.zip'

  • psql < /path/to/paperstorm.dump

Connect to database

  • psql paperstorm (or \c paperstorm from psql)
  • \d (show tables)
  • select * from leaflets limit 10;
  • select st_x(coordinates) as longitude, st_y(coordinates) as latitude, created_at from leaflets limit 10;

Connect from app

Database URL: 127.0.0.1:5432/paperstorm

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