Infrastructure to generate vector tiles for OpenSeaMap .
The entire project is structured in components using Docker containers to work together. Ensure you meet the prerequisites.
Please note that after changing the configuration files you need to rebuild the containers. See below for relevant configuration files.
Example: docker-compose build import-osm
- Install Docker
- Install Docker Compose
Start up the PostgreSQL database with the PostGIS extension.
docker-compose up -d postgres
Import the required database schema (views, prepared tables and helper functions).
docker-compose run db-schema
Now download a OSM PBF extract and store it in the ./data
dir.
Import the OSM PBF.
docker-compose run import-osm
Note: The mapping.yml determines which tables will be filled with which nodes and tags.
The mapping syntax is documented here.
To visualize and work with the vector tiles you can spin up Mapbox Studio in a Docker container and visit localhost:3000.
Then open the vector tile source with Browse
and choose from /projects/vector-datasource.tm2source
.
docker-compose up mapbox-studio
Edit the source settings by adding layers and using SQL queries to fetch data from
the tables created by the OSM Import
step.
This will modify the vector-datasource.tm2source file.
Export the vector tiles for the planet.
docker-compose run export-vectortiles
Note: The file export-mbtiles.sh determines
the options for the export. Change the bbox
according to your data.
Use klokantech/tileserver-gl to serve the tiles.
docker-compose up serve
Visit localhost:8080.
Exports the data as GeoJson
docker-compose run export-geojson
Note: The file export-geojson.sh determines the options for the export.
The data can be upload in Mapbox Studio to allow creating of styles using their tools. See the OSM2VectorTiles doc for details.