Skip to content
Steffen Exler edited this page Aug 5, 2020 · 6 revisions

Intro

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.

MapntikTileServer Frontend

What is a tile?

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.

Tile

What is a Tile-Server?

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.

Tile-Server overview

tiles 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.

MapntikTileServer vs other Tile-Servers

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.

MapntikTileServer workflow

Cookiecutter Django

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.

Celery Task Queue

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

More on: https://cookiecutter-django.readthedocs.io/en/latest/deployment-with-docker.html#building-running-production-stack

Celery-Task-Queue

Contents:

  1. Getting start local
  2. Getting start remote
  3. Commands
  4. Frontend
  5. Settings
  6. Config
  7. View
  8. Caching
  9. Monitoring
  10. URL's
  11. Openstreetmap-carto
  12. Sourcecode
  13. Tests
  14. Deployment
  15. Deployment Docker
  16. Continuous Integration
  17. Troubleshooting
Clone this wiki locally