This project is a MapBox Studio vector tile source for the style OSM Bright. It can be used to generate vector tiles from local OSM data.
- PostgreSQL
- PostGIS >= 2.0
- imposm >= 2.5.0
Download a dataset as osm.pbf
file from the GeoFabrik servers.
For example:
wget http://download.geofabrik.de/africa/tanzania-latest.osm.pbf
The following clones the source project and also postgis-vt-util, a collection of Postgres helper functions.
git clone https://github.com/osm-for-schools/osm-bright.tm2source.git
git clone https://github.com/mapbox/postgis-vt-util.git
sudo su postgres
psql -c "create database osm_tanzania;"
psql -d osm_tanzania -c "CREATE EXTENSION postgis;"
psql -d osm_tanzania -c "SELECT postgis_full_version();"
psql -d osm_tanzania -f postgis-vt-util/lib.sql
exit
imposm -U postgres -d osm_tanzania -m osm-bright.tm2source/imposm-mapping.py --read --write --optimize --deploy-production-tables --overwrite-cache tanzania-latest.osm.pbf
sudo su postgres
psql -d osm_tanzania -f osm-bright.tm2source/create-indices.sql
exit
Now you are ready to go. Open the source project osm-bright.tm2source
in MapBox Studio for the style OSM Bright.
If you used a different database name, set this name in the data.yml
file. Also when your database connection settings are differing.
To regenerate the file data.xml
, which is used to generate the tiles with Mapnik, save the source project again with MapBox Studio.
The vector tiles itselves can be generated with MapBox Studio (Export to MBTiles).
Note: This vector tile source is certainly incomplete and does not yet cover the full range of features used in the OSM Bright style.