Skip to content
Joel Stanner edited this page Feb 27, 2015 · 25 revisions

Table of Contents

  1. Database
  2. Application
  3. Processing
  4. Testing

Database

PostGIS

Option 1: Postgres.app

  1. Install Postgres.app
  2. Configure your path
  3. Verify that your path is correct:
which psql # should be /Applications/Postgres.app/Contents/Versions/9.4/bin/psql

Option 2: homebrew

  1. Update homebrew references - brew update
  2. Kill existing postgres process:
    • ps aux | grep postgres
    • sudo kill -term <# of process 'server log'>
  3. Upgrade Postgres - `brew upgrade postgres``
  4. Install Postgis - brew install postgis

Upgrading Postgres after installing Postgis will break Postgres' links to Postgis.

Install Postico

Create and populate a database

psql
create database seattle;
\connect seattle
create extension postgis; # enable postgis
\quit

Afterwards, import your data with shp2pgsql. One-line it with:

shp2pgsql -s 4326 -d -g the_geom shapefilename.shp shapefilename |psql -U username --password -p 5432 -h reallylonghostnametoamazonaws.com dbname

Start Postico, hit connect, and check that the data you intended import was imported.

psql

Manipulate a postgres database and it's records.

Login to the RDS instance with:

psql --host seattle-emergency.cwydhyrq6asz.us-west-2.rds.amazonaws.com --port 5432 --username codefellows --password --dbname seattle

Import a sql query:

psql -h hostname -d databasename -U username -f file.sql

shp2pgsql

Convert shapefiles into sql queries that can be loaded into postgres with psql.

shp2pgsql -s 4326 -d -g the_geom input.shp > output.sql

Visualize and manipulate geospatial datasets. Install with homebrew.

Application

Pyramid

Jinja2

Testing

pytest & SQLAlchemy

Normally all tests will use an in-memory SQLite database. You can run your tests with a different backend by using the --sql-url= commandline option. For example to run all tests against a local PostgreSQL server using the pytest database:

$ bin/py.test --sql-url=postgresql:///pytest
Clone this wiki locally