[OSM-dev] How to check for database updates after minutely Mapnik Installation?

Andy Allan gravitystorm at gmail.com
Fri Aug 19 14:28:35 BST 2011


On Fri, Aug 19, 2011 at 1:10 PM, Parveen Arora <mail at parveenarora.in> wrote:

>> You can instruct osm2pgsql to create a so-called dirty-tile-list which then
> What is the meaning of dirty tiles this term always confuses me.

A dirty tile is a map image that has been marked as being out-of-date,
and therefore needs to be redrawn when the system gets the chance.

Mod_tile does this by having a file
(/var/lib/mod_tile/planet-import-complete) whose modification
timestamp is the last time the planet database was updated. When it
serves a tile, it checks the timestamp on the tile and makes sure the
tile is newer than the timestamp on planet-import-complete. If it is
older, it asks renderd or tirex to re-render the tiles.

When you are running minutely updates, it's common to use the expiry
lists generated by osm2pgsql to "expire" the tiles that need changing.
Either the tiles are rendered directly, or they can be "marked dirty".
A tile can be "marked" as dirty by changing the timestamp to be really
old (amusingly, in OSM terms this means somewhere in 2000, which may
as well be the start of all time for us) so that it appears to be
older than the database import. That way it'll get re-rendered
automatically next time it's viewed.

When you make your own system not using tirex or renderd, you will
want to only re-render the tiles that need to be (rather than them
all). You'll need to take the list the osm2pgsql outputs, and then
either re-render them all in a script, or keep track of which ones are
needing re-rendering and do it later. If you update every minute then
sometimes you won't be able to keep up, hence the more complicated
approaches involving timestamps.

Cheers,
Andy



More information about the dev mailing list