[Tilecache] tilecache_seed force parameter

Christopher Schmidt crschmidt at metacarta.com
Sun Jan 18 21:27:03 EST 2009


On Thu, Jan 08, 2009 at 09:01:40AM +0100, Tibor Arpas wrote:
> Hi,
> 
> so I had time to look at Helder's mail and can confirm the bug.
> 
> Bug: the tilecache_seed.py --force .... doesn't take the --force into
> account for metaTile layers .
> Helder's patch with addition: attached in uniffied diff format..

Applied, thanks! 

> Tibor
> 
> 
> 
> On Fri, Jan 2, 2009 at 11:47 AM, Helder Brandão <helder.brandao at gmail.com>wrote:
> 
> >
> > Your patch is incomplete! Because in the python file Layer.py line 426:
> >   def render (self, tile):
> >       if self.metaTile:
> >           metatile = self.getMetaTile(tile)
> >           try:
> >               self.cache.lock(metatile)
> >               image = self.cache.get(tile)
> >               if not image:
> >                   image = self.renderMetaTile(metatile, tile)
> >
> > When arrive at "image = self.cache.get(tile)" the image exist (normally) so
> > it pulls the condition and it doesn't force the seed.
> >
> > My correction is:
> >
> > -    def render (self, tile):
> > +    def render (self, tile, force=False):
> >       if self.metaTile:
> >           metatile = self.getMetaTile(tile)
> >           try:
> >               self.cache.lock(metatile)
> > -               image = self.cache.get(tile)
> >
> > +              image = None
> > +              if not force:
> > +                    image = self.cache.get(tile)
> >               if not image:
> >                   image = self.renderMetaTile(metatile, tile)
> >
> > Best Regards,
> >
> > Helder Brandão
> >
> >
> > Tibor Arpas wrote:
> > >
> > > Hi,
> > >
> > > I think there is no way to specify force parameter for the
> > > tilecache_seed..
> > > We prefer not to clean our base map layer cache before we really have a
> > > new
> > > version, because the backend is not very reliable..Attached is a patch to
> > > tilecache_seed.py. It sure needs a little more cleaning up but it seems
> > to
> > > function. Also the parameters like padding and bbox were transformed to
> > be
> > > options using optparse. Patch is against trunk (revision 365).
> > >
> > > Tibor
> > >
> > >
> > > _______________________________________________
> > > Tilecache mailing list
> > > Tilecache at openlayers.org
> > > http://openlayers.org/mailman/listinfo/tilecache
> > >
> > >
> >
> > --
> > View this message in context:
> > http://n2.nabble.com/tilecache_seed-force-parameter-tp1837806p2101398.html
> > Sent from the TileCache mailing list archive at Nabble.com.
> >
> > _______________________________________________
> > Tilecache mailing list
> > Tilecache at openlayers.org
> > http://openlayers.org/mailman/listinfo/tilecache
> >



-- 
Christopher Schmidt
MetaCarta



More information about the Tilecache mailing list