3.5 KiB
layout | title | published |
---|---|---|
page | Create your own Vector Tiles | true |
Create your own vector tiles
We use Docker extensively for development and deployment. The easiest way to get started is using Docker Compose.
Clone the osm2vectortiles project.
git clone https://github.com/osm2vectortiles/osm2vectortiles.git
Start up your PostGIS container with the data container attached.
docker-compose up -d postgis
Download a PBF and put it into the local import
directory.
You can use extracts from Mapzen
or Geofabrik
wget https://s3.amazonaws.com/metro-extracts.mapzen.com/zurich_switzerland.osm.pbf
Now you need to import the PBF files into PostGIS.
docker-compose up import-osm
Now you need to import several external data sources. Import water polygons from OpenStreetMapData.com.
docker-compose up import-water
Import Natural Earth data for lower zoom levels.
docker-compose up import-natural-earth
Import custom country, sea and state labels.
docker-compose up import-labels
Now import custom SQL functions used in the source project.
docker-compose up import-sql
Update the scaleranks of OSM places with data from Natural Earth.
docker-compose up update-scaleranks
Export the data as MBTiles file to the export
directory.
docker-compose up export
Serve the tiles as raster tiles from export
directory.
docker-compose up serve
The tile server will no be visible on the docker host on port 8080
.
You can now see extract rendered as Open Streets v1.0
and if you have
style projects in your directory the rendered raster map as well.
Docker Images
The workflow consists of several prebuilt Docker images.
Image | Size |
---|---|
klokantech/tileserver-mapnik | |
osm2vectortiles/export | |
osm2vectortiles/import-external | |
osm2vectortiles/import-sql | |
osm2vectortiles/import-osm | |
osm2vectortiles/update-scaleranks | |
osm2vectortiles/postgis | |
osm2vectortiles/pgbouncer |