User:SomeoneElse/Force-rending tiles, and tidying old or empty ones

From OpenStreetMap Wiki
Jump to: navigation, search

Rendering lots of tiles

"render_list" can be used to render a series of tiles. I tend to use it to render lower zoom levels, something like:

render_list -f -n 1 -s /var/run/renderd/renderd.sock -z 0 -Z 10 -m default -a

That force-renders (-f) layers 0 to 10 worldwide, 1 metatile at a time (-n 1).


Removing blank tiles

One possible downside to rendering all tiles is that if you're working with an extract, many tiles will be blank. Blank tiles will however be small and can be removed afterwards (if for no other reason to free up inodes). To see what the minimum file size is for a particular layer (in this case 9), try:

cd /var/lib/mod_tile/default/9

ls -alR | more

and search for "meta". In my case the smallest file size is 7124 bytes, so

cd /var/lib/mod_tile/default/9

ls -alR | more

find . -name "*.meta" -type f -size 7124c -exec rm {} \; -print


will remove them.


Removing old tiles of a certain layer

If you've just made a style change that only affects e.g. zoom level 10, you can remove only metatiles in a certain zoom level older than a certain date, for example:

cd /var/lib/mod_tile/default/10

find . -type f ! -newermt 20151001 -exec rm {} \; -print


will remove any zoom level 10 tiles older than 1st October 2015.