[Tilecache] Basic Questions
Christopher Schmidt
crschmidt at metacarta.com
Tue Sep 18 21:03:34 EDT 2007
On Tue, Sep 18, 2007 at 05:50:25PM -0700, Jeffrey Johnson wrote:
> > > so this works 'ok' ... when the page loads it is blank :(
> >
> > Call map.zoomToMaxExtent() to get the ball rolling.
>
> No change in behavior. Strage, zoomToMapExtent() gets called when I
> click the globe, but doesnt want to do it if I put this in the js
> code. Not a big deal for now, but strange.
>
> > > ... as soon
> > > as I drag around the tiles appear. There is a thick black border
> > > around the image but only on the top and right.
> >
> > I expect that, but I think there's a fix in TileCache for it. Maybe some
> > property you can set on the layer with regard to transparency. Yeah,
> > maybe setting 'transparency=True' on the ImageLayer config would do it.
>
> Ah, this may have something to do with the size of the tiles? I.e. TC
> is cutting tiles that have extra space in them and making them black?
> ... Putting transparency=true into the layer definition in
> tilecache.cfg doesnt have any affect. Do you mean in the layer
> definition in the js?
No, I meant in TC: did you clear your cache after doing it?
It does come down to the fact that if your image is not evenly divisible by
maxRes * 256, you'll get the black space -- and even if you get it right
in one direction, you'll usually be off in the other.
> > > Is there something simple I am doing wrong with the dimensions?
> >
> > What makes you think that you might be? Not sure I understand.
>
> The black borders on the top and right, the trouble with the zoom
> levels, and the problem with zoomToMaxExtent() not working. Just not
> used to working with non-spatial images ;)
The black stuff is somewhat related - not wrong per se, just different
;) If the transparent=true thing didn't work even after clearing the
cache, I should probably investigate why not.
> One more question ... if I want to use TileCache to tile up 10s of
> 1000s of images ... is there a way I setup the cfg file on the fly.
> Basically, when the camera snaps an image, i want to pre-cut the tiles
> with tilecache_seed.py. Could I do this all in js?
No, you couldn't do this all in JS. There is an Example.py:
http://svn.tilecache.org/trunk/tilecache/Example.py
Which shows how you can write Python code to generate a service (Rather
than using service.load() from a config file), which would probably be
the right place to start.
Regards,
--
Christopher Schmidt
MetaCarta
More information about the Tilecache
mailing list