I am in the process of trying to revive Openptmap. I have experience in programming, Linux administration and Docker, but it’s my first time working with Mapnik and the tools surrounding it.
I have found some old instructions how Openptmap used to be set up as well as the configuration files surrounding it. Very roughly, the tiles were created like this:
- Download a PBF file of the region to be rendered
- Convert the PBF to O5M using osmconvert
- Filter out all the irrelevant objects using osmfilter with the supplied filter file
- Import the filtered O5M file into a PostGIS database
- Generate the tiles using Mapnik with the given XML style file.
While I did have success with this, it does not seem to be the most up-to-date and efficient approach. In particular, the osmconvert step takes really long without providing any actual value, and from what I read online, it seems that a typical setup nowadays would fetch deltas every now and again and rerender only the necessary tiles rather than downloading and rerendering the whole world every few days.
I have found openstreetmap-tile-server, which seems to be the recommended way to host OSM tiles these days. Out of the box, I think it doesn’t work with the existing Openptmap setup for two reasons:
openstreetmap-tile-serverdoes not provide a way to useosmfilteron the map data, and I think it also doesn’t support O5M files- If I run the
osmfilterscript externally, convert the result back to PBF and pass that as the “region” toopenstreetmap-tile-server, I assume that the automatic updates probably won’t work correctly as the service is not aware that my data is filtered.
I’m wondering whether I could adapt the Openptmap setup to be compatible with openstreetmap-tile-server. I noticed that there is an option NAME_LUA, which will be passed as --tag-transform-script to osm2pgsql. This option is used to do Lua tag transformations. Also, there is an option OSM2PGSQL_EXTRA_ARGS, which allows to specify arbitrary additional arguments for osm2pgsql.
Is the Lua tag transformation something that could replace the osmfilter configuration? If so, are there any resources that could help me convert the osmfilter configuration to a Lua script?
Or are there any other options that I could pass to osm2pgsql that would replicate the osmfilter setup?
Do you have any other ideas how I could improve this setup to improve rendering performance and to support automatic updates?