Skip to content
Example MVT server and map for pedagogical purposes
Branch: master
Clone or download
Latest commit 8b736e3 Jul 6, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
map-mapboxgl
map-openlayers Add README Jul 5, 2019
.gitignore Add MapBox GL JS example Jul 5, 2019
README.md Add python requirements Jul 3, 2019
minimal-mvt.py Update minimal-mvt.py Jul 5, 2019
requirements.txt Add python requirements Jul 3, 2019

README.md

Python Setup

The tile server requires a database connection, so set up a virtual environment and then install the psycopg2 driver using pip.

cd minimal-mvt
virtualenv --python python3 venv
source venv/bin/activate
pip install -r requirements.txt

Configuration

Edit minimal-mvt.py and the TABLE and DATABASE constants:

TABLE = {
    'table':'nyc_streets',
    'srid':'26918',
    'geomColumn':'geom',
    'attrColumns':'gid, name, type'
    }  

DATABASE = {
    'user':'pramsey',
    'password':'password',
    'host':'localhost',
    'port':'5432',
    'database':'nyc'
    }

Run

python3 minimal-mvt.py
You can’t perform that action at this time.