Can't directly access the cache from Potlatch

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

Can't directly access the cache from Potlatch

Eric Wolf-2
I think I'm missing something obvious:

I've setup tilecache.cgi to construct a cache of the NAIP imagery on my local server. So far, this works great as an "Custom" imagery source in Potlatch:


But I would also like to be able to hit the disk cache directly, ala:


I can successfully load individual images from the cache like this:


When I look at the Apache error log, I see "Cache hit:... Tile: x: 15060, y: 40188, z: 16

But in the naip/0/16/15060 directory, there are only four PNGs with filenames nothing like "40188.png":

25345.png, 25346.png, 25347.png, 25348.png, 

My tilecache.cfg looks like this:

[cache]
type=GoogleDisk
base=/osmcp/rails/public/naip

[0] 
type=WMS 
url=http://isse.cr.usgs.gov/ArcGIS/services/Combined/SDDS_Imagery/MapServer/WMSServer 
#layers=0
levels=19
bbox=-180,90,180,-90
srs=EPSG:102113 
spherical_mercator=true
tms_type=google
I guess this could be a moot point if there isn't a significant speed improvement hitting the cache directory directly vs. using tilecache.cgi as a proxy.
-Eric

-=--=---=----=----=---=--=-=--=---=----=---=--=-=-
Eric B. Wolf                           720-334-7734




_______________________________________________
Tilecache mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/tilecache
Reply | Threaded
Open this post in threaded view
|

Re: Can't directly access the cache from Potlatch

Ian Dees
On Wed, Sep 1, 2010 at 11:32 AM, Eric Wolf <[hidden email]> wrote:
I think I'm missing something obvious:

I've setup tilecache.cgi to construct a cache of the NAIP imagery on my local server. So far, this works great as an "Custom" imagery source in Potlatch:


But I would also like to be able to hit the disk cache directly, ala:


I can successfully load individual images from the cache like this:


When I look at the Apache error log, I see "Cache hit:... Tile: x: 15060, y: 40188, z: 16

But in the naip/0/16/15060 directory, there are only four PNGs with filenames nothing like "40188.png":

25345.png, 25346.png, 25347.png, 25348.png, 

My tilecache.cfg looks like this:

[cache]
type=GoogleDisk
base=/osmcp/rails/public/naip

[0] 
type=WMS 
url=http://isse.cr.usgs.gov/ArcGIS/services/Combined/SDDS_Imagery/MapServer/WMSServer 
#layers=0
levels=19
bbox=-180,90,180,-90
srs=EPSG:102113 
spherical_mercator=true
tms_type=google
I guess this could be a moot point if there isn't a significant speed improvement hitting the cache directory directly vs. using tilecache.cgi as a proxy.

Two things:

1. Tilecache does directory munging to guarantee that any one directory has a limited number of files in it. You probably actually want to look in the /osmcp/rails/public/naip/16/000/015/060/000/040/ directory for 188.png.
2. tms_type=google flips one of the axes on its head so the tiles that get saved in cache will have a different number than the ones on the disk.

After typing all this I noticed you used the GoogleDesk cache type, so I might be completely wrong.

_______________________________________________
Tilecache mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/tilecache
Reply | Threaded
Open this post in threaded view
|

Re: Can't directly access the cache from Potlatch

Eric Wolf-2
Yep. It's GoogleDisk, so the directory structure follows /layer/z/x/y.png.

The goal is to get a cache working that doesn't require tilecache.cgi in the middle.

-Eric

-=--=---=----=----=---=--=-=--=---=----=---=--=-=-
Eric B. Wolf                           720-334-7734





On Wed, Sep 1, 2010 at 10:50 AM, Ian Dees <[hidden email]> wrote:
On Wed, Sep 1, 2010 at 11:32 AM, Eric Wolf <[hidden email]> wrote:
I think I'm missing something obvious:

I've setup tilecache.cgi to construct a cache of the NAIP imagery on my local server. So far, this works great as an "Custom" imagery source in Potlatch:


But I would also like to be able to hit the disk cache directly, ala:


I can successfully load individual images from the cache like this:


When I look at the Apache error log, I see "Cache hit:... Tile: x: 15060, y: 40188, z: 16

But in the naip/0/16/15060 directory, there are only four PNGs with filenames nothing like "40188.png":

25345.png, 25346.png, 25347.png, 25348.png, 

My tilecache.cfg looks like this:

[cache]
type=GoogleDisk
base=/osmcp/rails/public/naip

[0] 
type=WMS 
url=http://isse.cr.usgs.gov/ArcGIS/services/Combined/SDDS_Imagery/MapServer/WMSServer 
#layers=0
levels=19
bbox=-180,90,180,-90
srs=EPSG:102113 
spherical_mercator=true
tms_type=google
I guess this could be a moot point if there isn't a significant speed improvement hitting the cache directory directly vs. using tilecache.cgi as a proxy.

Two things:

1. Tilecache does directory munging to guarantee that any one directory has a limited number of files in it. You probably actually want to look in the /osmcp/rails/public/naip/16/000/015/060/000/040/ directory for 188.png.
2. tms_type=google flips one of the axes on its head so the tiles that get saved in cache will have a different number than the ones on the disk.

After typing all this I noticed you used the GoogleDesk cache type, so I might be completely wrong.


_______________________________________________
Tilecache mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/tilecache
Reply | Threaded
Open this post in threaded view
|

Re: Can't directly access the cache from Potlatch

yvesm
  Le 2010-09-01 13:16, Eric Wolf a écrit :
> Yep. It's GoogleDisk, so the directory structure follows
> /layer/z/x/y.png.
>
> The goal is to get a cache working that doesn't require tilecache.cgi
> in the middle.
If you have mod_python, you'll get much faster access.

HTH,

Yves
_______________________________________________
Tilecache mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/tilecache
Reply | Threaded
Open this post in threaded view
|

Re: Can't directly access the cache from Potlatch

Ian Dees
In reply to this post by Eric Wolf-2
On Wed, Sep 1, 2010 at 12:16 PM, Eric Wolf <[hidden email]> wrote:
Yep. It's GoogleDisk, so the directory structure follows /layer/z/x/y.png.

I took a look at GoogleDisk.py and it looks like it is indeed "unflipping" for tms_type=google, so that theory is thrown out.

However, I think the logging still uses "real" TMS values when writing out, so take a look at what images are actually being requested from the server (in the browser).

I'm envisioning something like this:

Browser > TileCache Request Log > GoogleDisk
y=25347   y=40188                 y=25347

I'm running dry on ideas :)

... Hmm, this might make sense because at zoom z there are 2^z tiles in each column or row. 2^16=65536 and 25347+40188=65536. My bet is that if you expose these images directly to a Google Maps API or similarly-set-up OpenLayers system you would end up with a valid map.

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