Giter VIP home page Giter VIP logo

vector-datasource's Introduction

Mapzen Vector Tiles

See info about the hosted version of this service here:

Mapzen Vector Tile Service

Installation

Requirements:


#Installation Guide (tested under Ubuntu 14.04)

The installation is performed in three steps.

Imgur

1. Loading data (Make ready for using vector tiles)

Install postgres

sudo apt-get install postgresql postgresql-contrib postgis postgresql-9.3-postgis-2.1

You can find a more detailed description here.

Create database and extensions

# 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

Install osm2pgsql

sudo apt-get install osm2pgsql

Download data

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

Add data to the database

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 

2. PREPARE DATA

Download mapzen/vector-datasource:

git clone https://github.com/mapzen/vector-datasource.git

Prepare Database

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

3. CREATE VECTOR TILES

Download TileStache

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/

Install dependencies

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

Install TileStache

# 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

vector-datasource's People

Contributors

baldur avatar bcamper avatar edefritz avatar heffergm avatar hkrishna avatar macandrews21 avatar meetar avatar randymeech avatar rmarianski avatar sevko avatar yohanboniface avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.