[Tilecache] Patch: allow 'force' as a URL name to force re-generation

Gregor Mosheh gregor at hostgis.com
Sat Aug 9 14:51:38 EDT 2008


Hi, all. I have two patches to contribute, and apparently sending them 
to the list is the preferred way of doing so.

This patch checks whether the URL given is 'force' If it is, it forces 
re-generation of the tiles. This seems appropriate since a) the base is 
completely ignored anyway; and b) there is no mechanism for 
tilecache_seed.py to force regeneration.

Example:
./tilecache_seed.py force usa_states 4 8 -120,30,-110,50

This diff was from TC 2.01 but should apply to 2.04 as well.

--- Client.old.py       2008-08-09 11:15:18.000000000 -0700
+++ Client.py   2008-08-09 11:19:20.000000000 -0700
@@ -65,6 +65,8 @@ def seed (svc, base, layer, levels = (0,
      from Layer import Tile

      if not bbox: bbox = layer.bbox
+    force = False
+    if base.lower()=='force': force = True

      start = time.time()
      total = 0
@@ -81,7 +83,7 @@ def seed (svc, base, layer, levels = (0,
                  tileStart = time.time()
                  tile = Tile(layer,x,y,z)
                  bounds = tile.bounds()
-                svc.renderTile(tile)
+                svc.renderTile(tile,force)
                  total += 1
                  zcount += 1
                  box = "(%.4f %.4f %.4f %.4f)" % bounds




More information about the Tilecache mailing list