Created
April 19, 2012 00:14
-
-
Save munhitsu/2417488 to your computer and use it in GitHub Desktop.
osm-bright-mac-quickstart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# extended version of | |
# | |
# http://mapbox.com/tilemill/docs/guides/osm-bright-mac-quickstart/ | |
# | |
# install PostgreSQL (fresh) | |
brew install postgresql | |
initdb /usr/local/var/postgres | |
mkdir -p ~/Library/LaunchAgents | |
cp /usr/local/Cellar/postgresql/9.1.3/homebrew.mxcl.postgresql.plist ~/Library/LaunchAgents/ | |
launchctl load -w ~/Library/LaunchAgents/homebrew.mxcl.postgresql.plist | |
# check on Console that all is ok, I had rolling restart of server | |
brew install postgis | |
# just to ba safe I installed numpy | |
pip install numpy | |
# db creation | |
createdb -U $USER -E utf8 gis | |
psql -d gis -U $USER -f /usr/local/share/postgis/postgis.sql | |
psql -d gis -U $USER -f /usr/local/share/postgis/spatial_ref_sys.sql | |
brew install osm2pgsql && brew install --HEAD osm2pgsql | |
# optional | |
psql -d gis | |
#enter | |
CREATE EXTENSION hstore; | |
# to get rid of "failed: ERROR: AddGeometryColumn() - invalid SRID" | |
wget http://svn.openstreetmap.org/applications/utils/export/osm2pgsql/900913.sql && psql -f 900913.sql gis | |
# load osm file to gis db | |
osm2pgsql -c -G -d gis -H localhost -S /usr/local/share/osm2pgsql/default.style santiago.osm.pbf | |
# if fails than try | |
# as per: | |
# https://github.com/mapbox/tilemill/issues/1375 | |
psql -d gis -U $USER -f /usr/local/share/postgis/legacy_minimal.sql | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment