[OSM-dev] [PATCH] osm2pgsql tile expiry

Steve Hill steve at nexusuk.org
Sun Feb 8 14:13:44 GMT 2009

On Sun, 8 Feb 2009, Roeland Douma wrote:

> However I am wondering is it possible to add a range of zoom levels? Since I
> probably want to erase zoom 10-18.

My method is to use osm2pgsql to generate a list of dirty tiles at my 
maximum zoom level (17) and then the script which actually does the expiry 
can generate a list of tiles for all the lower zoom levels from this 
information alone.

e.g. if tile (x, y, 17) is expired, you know that you also need to expire 
(x/2, y/2, 16), (x/4, y/4, 15), (x/8, y/8, 14), etc.

See: https://subversion.nexusuk.org/trac/browser/openpistemap/trunk/scripts/expire_tiles.py

I'm still trying to improve the performance of the expire_tiles.py script, 
but the premise is that it looks on the disk to see what tiles actually 
exist and inserts a reference to them into a Postgres table together with 
a time stamp.  This means that I can expire higher zoom levels more 
frequently than lower levels (e.g. we don't want zoom level 0 to be 
expired every time someone makes a change anywhere on the planet :)

  - Steve
    xmpp:steve at nexusuk.org   sip:steve at nexusuk.org   http://www.nexusuk.org/

      Servatis a periculum, servatis a maleficum - Whisper, Evanescence

More information about the dev mailing list