User:SomeoneElse/mod tile 28

From OpenStreetMap Wiki
Jump to navigation Jump to search

The mod_tile tileserver zoom level is hardcoded at 20, as noted in [1]. In order to increase this the metatile storage format needs to be changed.

I can't take a lot of credit for this, since the changes needed were described years ago on the dev mailing list: https://lists.openstreetmap.org/pipermail/dev/2011-January/021656.html .

The "business end" of the rendering changes are here: https://github.com/SomeoneElseOSM/mod_tile/commit/d4db05fef67eedebbbaf39e00f30e11fa84d4d79 . Essentially, metatiles need to be accessed via 7 bytes rather than 5, in order to handle zooms up to 28. http://wiki.openstreetmap.org/wiki/Slippy_map_tilenames#X_and_Y describes slippy map tilenames, and the max X and Y would fit into an integer up to zoom 32.

Note that after applying this change you'll need to delete and cached metatiles that you might have, since the path to each one is now different.

Clearly keeping large numbers of tiles around at zoom 28 isn't a good idea as disk space will be quickly used up. Also note that neither osm2pgsql nor render_expired like a very large MAXZOOM passed to them when updating a rendering database, so another strategy is needed to deal with very high zoom tiles (such as deleting them nightly).

The munin plugins the mod_tile comes with default to zooms up to 20, but changing these scripts is trivial (just distribute the zoom levels among the available buckets as needed).

The resultant version of mod_tile is at https://github.com/SomeoneElseOSM/mod_tile/tree/zoom2022 .