Skip to content

A vector tile source for the Mapbox Studio style osm-bright.tm2 (WIP)

Notifications You must be signed in to change notification settings

osm-for-schools/osm-bright.tm2source

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

38 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

osm-bright.tm2source

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.

Requirements

  • PostgreSQL
  • PostGIS >= 2.0
  • imposm >= 2.5.0

Download OpenStreetMap data

Download a dataset as osm.pbf file from the GeoFabrik servers. For example:

wget http://download.geofabrik.de/africa/tanzania-latest.osm.pbf

Get the projects

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

Setup the database

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

Import the data

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

Add additional indices

sudo su postgres
psql -d osm_tanzania -f osm-bright.tm2source/create-indices.sql
exit

Use the source, Luke

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.

About

A vector tile source for the Mapbox Studio style osm-bright.tm2 (WIP)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages