Last active
August 29, 2016 11:23
-
-
Save yalovek/e99ffe9dc5f9537a7640 to your computer and use it in GitHub Desktop.
Installation guide of OSM project for OS X
This file contains hidden or 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
| #!/bin/sh | |
| # Install brew | |
| xcode-select --install | |
| http://xquartz.macosforge.org/landing/ | |
| http://support.apple.com/kb/DL1572 | |
| ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" | |
| brew update | |
| brew doctor | |
| # Install Node | |
| brew install node | |
| # Install Postgres | |
| brew install postgresql | |
| ln -sfv /usr/local/opt/postgresql/*.plist ~/Library/LaunchAgents | |
| launchctl load ~/Library/LaunchAgents/homebrew.mxcl.postgresql.plist | |
| # Install Postgis | |
| brew install postgis | |
| mkdir -p /Users/vadim/Library/Python/2.7/lib/python/site-packages | |
| echo 'import site; site.addsitedir("/usr/local/lib/python2.7/site-packages")' >> /Users/vadim/Library/Python/2.7/lib/python/site-packages/homebrew.pth | |
| # Import OSM to Postgres | |
| brew install protobuf-c | |
| brew install osm2pgsql --with-protobuf-c | |
| createdb osm | |
| psql -d osm -c "create extension postgis;" | |
| osm2pgsql -cGs -d osm -S /usr/local/share/osm2pgsql/default.style ~/Downloads/monaco-latest.osm.pbf | |
| curl -O http://data.openstreetmapdata.com/simplified-land-polygons-complete-3857.zip | |
| curl -O http://data.openstreetmapdata.com/land-polygons-split-3857.zip | |
| # Install OSM Bright | |
| git clone [email protected]:mapbox/osm-bright.git | |
| cd osm-bright | |
| ./make.py | |
| # Install TileMill | |
| git clone [email protected]:mapbox/tilemill.git | |
| cd tilemill | |
| npm install | |
| ./index.js | |
| # Install TileStream | |
| git clone [email protected]:mapbox/tilestream.git | |
| cd tilestream | |
| npm install | |
| ./index.js | |
| # Install PIP | |
| brew install python | |
| # Install virtualenv | |
| pip install virtualenv | |
| pip install virtualenvwrapper | |
| export WORKON_HOME=$HOME/.virtualenvs | |
| echo 'add to .bash_profile' | |
| echo '. /usr/local/bin/virtualenvwrapper.sh' | |
| # Import map to db | |
| createdb gis | |
| psql -d gis -c 'CREATE EXTENSION postgis; CREATE EXTENSION hstore;' | |
| osm2pgsql --create --cache-strategy sparse -C 750 -U vadim -S osm2pgsql.style.txt -d gis -k monaco-latest.osm.pbf | |
| # Install Vector Datasource | |
| git clone https://github.com/mapzen/vector-datasource.git | |
| cd vector-datasource/data | |
| wget -O gist.sh https://gist.githubusercontent.com/rmarianski/491e50f3dd7159ebdf23/raw/c40439e9f5761d4f5ad0846a334a49ff1d6024a2/gistfile1.txt | |
| open gist.sh | |
| chmod +x gist.sh | |
| ./gist.sh | |
| # Install TileStache | |
| git clone https://github.com/mapzen/TileStache.git | |
| git fetch --all | |
| git checkout integration-1 | |
| mkvirtualenv TileStache | |
| pip install pillow | |
| pip install shapely | |
| pip install protobuf | |
| python setup.py install | |
| pip install werkzeug | |
| pip install modestmaps | |
| pip install mapbox_vector_tile | |
| pip install psycopg2 | |
| pip install simplejson | |
| ./scripts/tilestache-server.py -c ../vector-datasource/tilestache.cfg | |
| # Import Data for Node Tile Server | |
| brew install osmosis | |
| createdb osm_node | |
| psql -d osm_node -c "CREATE EXTENSION postgis;" | |
| psql -d osm_node -c "CREATE EXTENSION hstore;" | |
| psql -d osm_node -f /usr/local/Cellar/osmosis/0.43/libexec/script/pgsimple_schema_0.6.sql | |
| psql -d osm_node -f /usr/local/Cellar/osmosis/0.43/libexec/script/pgsimple_schema_0.6_linestring.sql | |
| psql -d osm_node -f /usr/local/Cellar/osmosis/0.43/libexec/script/pgsimple_schema_0.6_bbox.sql | |
| psql -d osm_node -f /usr/local/Cellar/osmosis/0.43/libexec/script/pgsimple_schema_0.6_action.sql | |
| osmosis --read-xml file="/Users/vadim/Downloads/andorra-latest.osm.bz2" --write-pgsimp database="osm_node" | |
| # Install Node Tile Server | |
| git clone [email protected]:fabrik42/node_tile_server.git | |
| brew install cairo | |
| export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig/:/usr/X11/lib/pkgconfig | |
| npm install -g coffee-script | |
| npm install | |
| cake build |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment