13.01.2026 | Michael Reichert
If you render maps using the Mapnik rendering engine, you might have come across Nik4 by Ilya Zverev. It is a Python utility rendering single map images for a given bounding box, center coordinate, image dimensions and/or scale. At Geofabrik we use it to create maps for printouts.
Nik4 has one problem. It relies on Mapnik’s Python bindings. They do not have any releases and fail to build from time to time. In order to get rid of that unstable dependency, we decided to port Nik4 to C++ because Mapnik is written in C++.
Nik5 aims to behave exactly as Nik4 in order to make migration easy for its users. However, the syntax of the command line options --bbox, --size-px and --size was changed from space to comma as separator. If you wrote --size-px 800 600 in the past, you now have to use --size-px 800,600.
Nik4 used ImageMagick’s montage utility to stitch tiles together if the requested map size exceeded the maximum image limits of Mapnik. We replaced it by the libgd. Tiles will be stored in memory now and not stored as temporary files on disk.
If you render large images beyond Mapnik’s limits, you will appreciate the new --tile-buffer option. It will render all tiles with a buffer to avoid labels being cut at tile boundariess.
The code is published on Codeberg.