Setup homebrew:
/usr/bin/ruby -e "$(/usr/bin/curl -fsSL https://raw.github.com/mxcl/homebrew/master/Library/Contributions/install_homebrew.rb)"
Then:
brew tap homebrew/versions
Install required libraries:
easy_install numpy
Then:
brew install geos proj gdal postgresql postgis15
Initialize the server:
initdb /usr/local/var/postgres
May need to start postgres manually:
pg_ctl -D /usr/local/var/postgres -l /usr/local/var/postgres/server.log start
Or stop:
pg_ctl -D /usr/local/var/postgres stop -s -m fast
Setup template database:
createdb -E UTF8 template_postgis psql -d postgres -c "UPDATE pg_database SET datistemplate='true' WHERE datname='template_postgis';" POSTGIS_SQL_PATH=/usr/local/Cellar/postgis15/1.5.3/share/postgis psql -d template_postgis -f $POSTGIS_SQL_PATH/postgis.sql psql -d template_postgis -f $POSTGIS_SQL_PATH/spatial_ref_sys.sql psql -d template_postgis -c "GRANT ALL ON geometry_columns TO PUBLIC;" psql -d template_postgis -c "GRANT ALL ON geography_columns TO PUBLIC;" psql -d template_postgis -c "GRANT ALL ON spatial_ref_sys TO PUBLIC;"
Set up database:
createdb sampledb -T template_postgis
Created
July 27, 2012 15:22
-
-
Save binarymatt/3188630 to your computer and use it in GitHub Desktop.
Postgis on a mac
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment