Dockerized project for generating openstreets-nl-rd (EPSG:28892) raster tiles
1.7K
Generating openstreets-nl-rd raster tiles with Mapnik and Docker!
Related project: openstreets-nl-tilemill.
This project is part of an internship assignment which aimed at creating tiled basemaps for the KNMI geospatial infrastructure. The data and tools used to create the openstreets-nl basemap are open-source. Therefore, this project is reproducible for everyone who wants to create simple basemaps (raster tiled basemaps) from free vector data! This repository contains all the necessary instructions and files to generate openstreets-nl tiles with Mapnik and a generate_tiles.py script inside a docker container.
The openstreets-nl-rd basemap style was based on the openstreets-nl-tilemill project in which OpenStreetMap/Natural Earth data was used to create custom styled raster tiles with CartoCSS/Tilemill. Instead of using Tilemill to create the tiles, this directory contains instructions to generate customized openstreets-nl-rd tiles with Mapnik generate_tiles.py script inside a docker container.
Can be built from the Dockerfile:
docker build -t ingmapping/docker-openstreets-nl-rd github.com/ingmapping/docker-openstreets-nl-rd.git
or pulled from Docker Hub:
docker pull ingmapping/docker-openstreets-nl-rd
To run the container, replace 'pwd' by your current working directory (the directory where you want the tiles to be exported) and use the following command:
docker run -i -t --rm --name docker-openstreets-nl-rd -v 'pwd'/:/data ingmapping/docker-openstreets-nl-rd
The above command will generate openstreets-nl-rd tiles for zoomlevel 0 to 16 (it can take a while) in a folder called 'tiles'. If you want to generate openstreets-nl-rd tiles for other zoom levels you can use the environement variables "MIN_ZOOM" and "MAX_ZOOM". For example, for zoom level 3 to 4:
docker run -i -t --rm --name docker-openstreets-nl-rd -v 'pwd'/:/data -e MIN_ZOOM=3 -e MAX_ZOOM=14 ingmapping/docker-openstreets-nl-rd
How to remove your exported tiles if permission problems:
If the tiles are created by root inside the Docker container it can cause problems when you want to remove your tiles locally on the host with a non-root user. A solution how to remove the files is to run another docker container:
docker run -it --rm -v 'pwd'/:/mnt:z phusion/baseimage bash
cd mnt
rm -rf tiles
exit
Once that you have your tiles exported in a folder directory structure, you can use/view the generated raster tiles using various JavaScript mapping libraries. OpenLayers can handle custom projections out of the box, and Leaflet with the Proj4Leafletplugin. For configuration settings for the viewer see: RD_projection.txt
Content type
Image
Digest
Size
1.1 GB
Last updated
about 8 years ago
docker pull ingmapping/docker-openstreets-nl-rd