locating bad tiles...

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

locating bad tiles...

John Cole X
I have a few tiles that apparently have bad image files behind them (TC
returns very slowly, and the tiles show up white instead of pink). It would
be nice to be able to set an option in the config file to overlay the
filename of the tile somehow so I can find the few, seemingly random tiles
and remove them, without deleting the entire zoom level.

With the addition of the watermarking feature, could it also do this?

Thanks,

John

No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.5.467 / Virus Database: 269.6.2/785 - Release Date: 5/2/2007 2:16
PM
 
This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the sender. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail.
_______________________________________________
Tilecache mailing list
[hidden email]
http://openlayers.org/mailman/listinfo/tilecache
Reply | Threaded
Open this post in threaded view
|

Re: locating bad tiles...

Christopher Schmidt-2
On Thu, May 03, 2007 at 10:14:24AM -0500, John Cole wrote:
> I have a few tiles that apparently have bad image files behind them (TC
> returns very slowly, and the tiles show up white instead of pink). It would
> be nice to be able to set an option in the config file to overlay the
> filename of the tile somehow so I can find the few, seemingly random tiles
> and remove them, without deleting the entire zoom level.

If debug for the layer is on (the default) every tile access is recorded
in the error.log under apache, or wherever stderr goes on other servers.
In this way, you can see the z/x/y of the tile, from which you can
determine the tile.

Not sure if this helps or not.

Regards,
--
Christopher Schmidt
MetaCarta
_______________________________________________
Tilecache mailing list
[hidden email]
http://openlayers.org/mailman/listinfo/tilecache
Reply | Threaded
Open this post in threaded view
|

Re: locating bad tiles...

Tim Schaub-2
In reply to this post by John Cole X
John Cole wrote:
> I have a few tiles that apparently have bad image files behind them (TC
> returns very slowly, and the tiles show up white instead of pink). It would
> be nice to be able to set an option in the config file to overlay the
> filename of the tile somehow so I can find the few, seemingly random tiles
> and remove them, without deleting the entire zoom level.

See attached (quick hack) TileUtil.py.

If you can right-click a tile to get the URL, you can

TileUtil.forceRefresh(url)

to trash the bad one and request a new one.

Tim


>
> With the addition of the watermarking feature, could it also do this?
>
> Thanks,
>
> John
>
> No virus found in this outgoing message.
> Checked by AVG Free Edition.
> Version: 7.5.467 / Virus Database: 269.6.2/785 - Release Date: 5/2/2007 2:16
> PM
>  
> This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the sender. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail.
> _______________________________________________
> Tilecache mailing list
> [hidden email]
> http://openlayers.org/mailman/listinfo/tilecache

import TileCache
import cgi
import os

def getServiceLayerTileBounds(url):
    """Return layer, tile, and bounds given the url."""
   
    bounds = None
    if url.find('?') != -1:
        queryDict = cgi.parse_qs(url.split('?')[1])
        queryDict = dict([(k.upper(), v) for (k, v) in queryDict.iteritems()])
        bounds = [float(i) for i in queryDict['BBOX'][0].split(',')]
        layerName = queryDict['LAYERS'][0]

    cfgfiles = TileCache.cfgfiles
    service = TileCache.Service.load(*cfgfiles)
    layer = service.layers[layerName]
    tile = layer.getTile(bounds)
    return service, layer, tile, bounds
   
def getTilePath(url):
    """Return the disk based tile path for the tile represented by the url."""
   
    service, layer, tile, bounds = getServiceLayerTileBounds(url)
    return service.cache.getKey(tile)

def forceRefresh(url):
    """Delete the disk based tile and request another one given the url."""
   
    service, layer, tile, bounds = getServiceLayerTileBounds(url)
    path = service.cache.getKey(tile)
    os.unlink(path)
    data = layer.render(tile)
    service.cache.set(tile, data)
_______________________________________________
Tilecache mailing list
[hidden email]
http://openlayers.org/mailman/listinfo/tilecache
Reply | Threaded
Open this post in threaded view
|

Re: locating bad tiles...

John Cole X
In reply to this post by John Cole X
Tim,
  Thanks for the file, it appears like it will work, but I have to admin,
I'm not a python person, so I've tried several ways of using this all to no
avail.

  I've tried the IDLE shell, command line, cgi :-)  I'm afraid I'm going to
need a few quick instructions on how to execute this with one of my image
url's

Thanks!

John

-----Original Message-----
From: [hidden email]
[mailto:[hidden email]] On Behalf Of Tim Schaub
Sent: Friday, May 04, 2007 11:12 AM
To: [hidden email]
Subject: Re: [Tilecache] locating bad tiles...

John Cole wrote:
> I have a few tiles that apparently have bad image files behind them (TC
> returns very slowly, and the tiles show up white instead of pink). It
would
> be nice to be able to set an option in the config file to overlay the
> filename of the tile somehow so I can find the few, seemingly random tiles
> and remove them, without deleting the entire zoom level.

See attached (quick hack) TileUtil.py.

If you can right-click a tile to get the URL, you can

TileUtil.forceRefresh(url)

to trash the bad one and request a new one.

Tim


>
> With the addition of the watermarking feature, could it also do this?
>
> Thanks,
>
> John
>
> No virus found in this outgoing message.
> Checked by AVG Free Edition.
> Version: 7.5.467 / Virus Database: 269.6.2/785 - Release Date: 5/2/2007
2:16
> PM
>  
> This email and any files transmitted with it are confidential and intended
solely for the use of the individual or entity to whom they are addressed.
If you have received this email in error please notify the sender. This
message contains confidential information and is intended only for the
individual named. If you are not the named addressee you should not
disseminate, distribute or copy this e-mail.
> _______________________________________________
> Tilecache mailing list
> [hidden email]
> http://openlayers.org/mailman/listinfo/tilecache


No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.5.467 / Virus Database: 269.6.2/787 - Release Date: 5/3/2007 2:11
PM
 
   

No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.5.467 / Virus Database: 269.6.2/787 - Release Date: 5/3/2007 2:11
PM
 
This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the sender. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail.
_______________________________________________
Tilecache mailing list
[hidden email]
http://openlayers.org/mailman/listinfo/tilecache
Reply | Threaded
Open this post in threaded view
|

Re: locating bad tiles...

Tim Schaub-2
John Cole wrote:
>   I've tried the IDLE shell, command line, cgi :-)  I'm afraid I'm going to
> need a few quick instructions on how to execute this with one of my image
> url's

Put the TileUtil.py script in the same directory as your TileCache
directory (right next to tilecache.cgi).  Then get yourself to that
directory and fire up python (run python from the command line).  From
the python command line,

 >>> import TileUtil
 >>> TileUtil.forceRefresh("http://host/path/to/tilecache.cgi?query")

Note that this is not a "real" tilecache utility, just a quick solution
to address the same issue you are having.

Tim

>
> Thanks!
>
> John
>
> -----Original Message-----
> From: [hidden email]
> [mailto:[hidden email]] On Behalf Of Tim Schaub
> Sent: Friday, May 04, 2007 11:12 AM
> To: [hidden email]
> Subject: Re: [Tilecache] locating bad tiles...
>
> John Cole wrote:
>> I have a few tiles that apparently have bad image files behind them (TC
>> returns very slowly, and the tiles show up white instead of pink). It
> would
>> be nice to be able to set an option in the config file to overlay the
>> filename of the tile somehow so I can find the few, seemingly random tiles
>> and remove them, without deleting the entire zoom level.
>
> See attached (quick hack) TileUtil.py.
>
> If you can right-click a tile to get the URL, you can
>
> TileUtil.forceRefresh(url)
>
> to trash the bad one and request a new one.
>
> Tim
>
>
>> With the addition of the watermarking feature, could it also do this?
>>
>> Thanks,
>>
>> John
>>
>> No virus found in this outgoing message.
>> Checked by AVG Free Edition.
>> Version: 7.5.467 / Virus Database: 269.6.2/785 - Release Date: 5/2/2007
> 2:16
>> PM
>>  
>> This email and any files transmitted with it are confidential and intended
> solely for the use of the individual or entity to whom they are addressed.
> If you have received this email in error please notify the sender. This
> message contains confidential information and is intended only for the
> individual named. If you are not the named addressee you should not
> disseminate, distribute or copy this e-mail.
>> _______________________________________________
>> Tilecache mailing list
>> [hidden email]
>> http://openlayers.org/mailman/listinfo/tilecache
>
>
> No virus found in this incoming message.
> Checked by AVG Free Edition.
> Version: 7.5.467 / Virus Database: 269.6.2/787 - Release Date: 5/3/2007 2:11
> PM
>  
>    
>
> No virus found in this outgoing message.
> Checked by AVG Free Edition.
> Version: 7.5.467 / Virus Database: 269.6.2/787 - Release Date: 5/3/2007 2:11
> PM
>  
> This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the sender. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail.

_______________________________________________
Tilecache mailing list
[hidden email]
http://openlayers.org/mailman/listinfo/tilecache