[Tilecache] TileCache with 2 layers & Java Servlet (Jon)

Jon Blower jdb at mail.nerc-essc.ac.uk
Wed Jun 20 03:48:03 EDT 2007


Dear Duarte,

Sorry for not replying to this (or your previous email) before - I am
still catching up on emails after a long period out of the office!
I'm afraid I don't have any time right now to look at this, and
anyway, I haven't used TileCache much myself and the Java servlet
isn't well tested so I probably can't help with your problem, sorry.

When I get a chance I'll update the TileCache version in the Java
servlet.  However, if you want to have a go at this yourself, you
should just be able to do the following:

1) Replace the contents of WEB-INF/jython/TileCache with the latest
version of the code
2) Edit Cache.py to provide a replacement for os.access(), which
doesn't exist in Jython.  You can look at the existing Cache.py to see
what I did.  Essentially, I defined canRead() and canWrite() for both
Jython and Python, then use these methods instead of os.access() in
the rest of the code:

if sys.platform.startswith("java"): # Detects Jython
    from java.io import File
    def canRead(path):
        return File(path).canRead()
    def canWrite(path):
        return File(path).canWrite()
else:
    def canRead(path):
        return os.access(path, os.R_OK)
    def canWrite(path):
        return os.access(path, os.W_OK)

(Chris, perhaps these changes could be incorporated into the trunk if
you have time?)  Unless other things have changed in TileCache, this
should work.  If you try this, please let me know how you get on!

Cheers, Jon

On 6/19/07, Christopher Schmidt <crschmidt at metacarta.com> wrote:
> On Tue, Jun 19, 2007 at 07:04:51PM +0100, Duarte Carreira wrote:
> > The problem is that the 1st layer works fine, but the second I get the
> > usual error "Cannot determine ... from bounds" (I don't have access to
> > the server right now, so cannot get the exact error message).
>
> "If you are using TileCache for overlays, you should set the 'reproject'
> option on the layer to 'false'." -- http://tilecache.org/readme.html
>
>  Layer.WMS('name', 'url', {'layers':'foo'}, {'reproject':false});
>
> > Also, on a foot-note, is it possible to drop-in a newer version of
> > TileCache into the servlet? (I'm hoping Jon reads this)
>
> I have no idea if Jon reads this. I have it as a goal to get the
> servlet stuff he did merged back into trunk where possible, so that it
> could be up to date, but we haven't talked at all about it. It's not
> real high on my list either.
>
> Regards,
> --
> Christopher Schmidt
> MetaCarta
> _______________________________________________
> Tilecache mailing list
> Tilecache at openlayers.org
> http://openlayers.org/mailman/listinfo/tilecache
>


-- 
--------------------------------------------------------------
Dr Jon Blower              Tel: +44 118 378 5213 (direct line)
Technical Director         Tel: +44 118 378 8741 (ESSC)
Reading e-Science Centre   Fax: +44 118 378 6413
ESSC                       Email: jdb at mail.nerc-essc.ac.uk
University of Reading
3 Earley Gate
Reading RG6 6AL, UK
--------------------------------------------------------------



More information about the Tilecache mailing list