Skip to content

Instantly share code, notes, and snippets.

@davemasse
Created October 3, 2011 13:35
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 davemasse/1259116 to your computer and use it in GitHub Desktop.
Save davemasse/1259116 to your computer and use it in GitHub Desktop.
Creating a postgis-enabled database for geocoding
#!/bin/bash
DATABASE=''
POSTGISPATH=''
USER=''
sudo -u postgres createdb -O $USER $DATABASE
sudo -u postgres psql -d $DATABASE -f $POSTGISPATH/postgis/postgis.sql
sudo -u postgres psql -d $DATABASE -f $POSTGISPATH/spatial_ref_sys.sql
bash $POSTGISPATH/extras/tiger_geocoder/tiger_2010/create_geocode.sh
sudo -u postgres psql -d $DATABASE -c "GRANT ALL ON spatial_ref_sys to $USER"
sudo -u postgres sh $POSTGISPATH/extras/tiger_geocoder/tiger_2010/upgrade_geocoder.sh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment