See info about the hosted version of this service here:
Requirements:
- TileStache
- PostGIS
- An OpenStreetMap database created by osm2pgsql
- Natural Earth tables from contents of
data/
.
#Installation Guide (tested under Ubuntu 14.04)
The installation is performed in three steps.
sudo apt-get install postgresql postgresql-contrib postgis postgresql-9.3-postgis-2.1
You can find a more detailed description here.
# switch to user postgres
sudo -i -u postgres
# create new database
createdb gis
# create extensions
psql -d gis -c 'CREATE EXTENSION postgis; CREATE EXTENSION hstore;'
# check the results
psql -d gis
\conninfo
# logout from db
\q
# logout user postgres
exit
sudo apt-get install osm2pgsql
Here we use data from geofabrik, but you can use other *.pbf files.
# switch to new data path
cd /path/to/your/osm/data
# download data
wget http://download.geofabrik.de/europe/austria-latest.osm.pbf
Start osm2pgsql in your data folder. Before you start the osm2pgsql script you might need to check your postgresql user rights (pg_hba.conf)
osm2pgsql --create --cache-strategy sparse -C 750 -U postgres -S osm2pgsql.style.txt -d gis -k austria-latest.osm.pbf
git clone https://github.com/mapzen/vector-datasource.git
Download the file at https://gist.github.com/rmarianski/491e50f3dd7159ebdf23 and drop it in the ../vector-datasource/data/ folder as gist.sh, or just type...
# change to folder
cd vector-datasource/data
# download file
wget -O gist.sh https://gist.githubusercontent.com/rmarianski/491e50f3dd7159ebdf23/raw/c40439e9f5761d4f5ad0846a334a49ff1d6024a2/gistfile1.txt
Open the file gist.sh and change database options accordingly (leave out -h host when using a local machine):
# database options
export PGPASSWORD=password
PGOPTS="-d database -h host -U user"
then run the gist.sh script:
# make sript executable
chmod +x gist.sh
# execute the script
./gist.sh
git clone https://github.com/mapzen/TileStache.git
# Check out to integration-1 fork for serving .mapbox vectortiles
git fetch --all
git checkout integration-1
You can find TileStache at https://github.com/mapzen/TileStache/
Follow the instructions at https://github.com/TileStache/TileStache or do
# install pip
curl -O -L https://raw.github.com/pypa/pip/master/contrib/get-pip.py
sudo python get-pip.py
rm get-pip.py
# install other build dependecies (check if you need all of them)
sudo apt-get install build-essential autoconf libtool pkg-config python-opengl python-imaging python-pyrex python-pyside.qtopengl idle-python2.7 qt4-dev-tools qt4-designer libqtgui4 libqtcore4 libqt4-xml libqt4-test libqt4-script libqt4-network libqt4-dbus python-qt4 python-qt4-gl libgle3 python-dev zlib1g-dev libjpeg-dev python-psycopg2
# install pillow (better alternative to PIL)
sudo pip install pillow
# install mapnik
sudo add-apt-repository ppa:mapnik/nightly-2.3
sudo apt-get update
sudo apt-get install -y libmapnik mapnik-utils python-mapnik
sudo pip install shapely
sudo pip install protobuf
# change folder
cd TileStache/
# install TileStache
sudo python setup.py install
# start server with mapzen .cfg file
./scripts/tilestache-server.py -c path/to/mapzen-vector-datasource/tilestache.cfg
# test your configurations
http://localhost:8080/osm/buildings/16/19293/24641.json