-
Notifications
You must be signed in to change notification settings - Fork 5
Home
The MapntikTileServer is a time sensitive mapnik based Tile-Server for OpenStreetMap and Open Historical Data Map. Written in python with the web framework Django and the official OpenStreetMap style sheets.
A tile is a part of a map. On each zoom level, the map is split into zoom^4 map parts (tiles). On zoomlevel 0, the world map equals one tile. On each consecutive zoomlevel, the number of tiles is multiplied by four.
A Tile-Server is a web service which handle user request over the HTTP
/ HTTPS
protocol. A user request is defined over the request URL and contains the requested date and position.
The Tile-Server send a single tile as a response.
a single tile of a map.
There are some JavaScript libraries, which can handle Tile-Server request and merge each tile to a map. The two most common libraries are Leaflet and OpenLayers.
The main difference is, that this can handle time request. So you
can request a map of a specific date. To handle date specific request,
the project openstreetmap-carto
was use as base. Openstreetmap-carto
is the github repository for the style sheets, which are used on https://openstreetmap.org/.
To add time sensitive request, the project was forked
and the project.mml
file was modified to make SQL
request for a specific day.
On the diagram below, we depict the workflow of the MapntikTileServer.
Cookiecutter Django is a framework for jumpstarting production-ready Django projects quickly. ([Source](https://github.com/pydanny/cookiecutter-django))
The project was created with Cookiecutter Django and build up with docker. So if you unsure how to use this MapntikTileServer, read the Cookiecutter Django Docs for help.
For faster developing and better testing, this project use Docker and Docker-Compose to build and run the MapntikTileServer.
For the production setup, the produce in a Celery-Task-Queue. Celery is a python task queue, which run in extra threads to increase the performance and stability. Celery auto scale the background tile processing threads depending on the system load. For every URL of a tile, which is not already in the cache, there will be triggered a new task on the queue.
Every celery container has multiple threads, where it can process tile request. To scale up the production you can use with docker:
$ docker-compose -f production.yml scale celeryworker=2