[Tilecache] getTile problem

Benoit PESTY tchule at hotmail.com
Fri Jun 8 11:20:30 EDT 2007


Hello,

I'm having a problem using tilecache + openlayers + mapserver.

The cache is installed and works when I look for the complete image with the 
max extend but when I try to use it with OpenLayers I have a problem of 
resolution/cell finding.

I've added debug in the getTile() method and the problem seems to be that 
the bounding boxes requested by openlayer doesn't match the defined bounding 
box :

An error occurred: can't find resolution index for 1761.683333 in 
[4492.0390625, 2246.01953125, 1123.009765625, 561.5048828125, 
280.75244140625, 140.376220703125, 70.1881103515625, 35.09405517578125, 
17.547027587890625, 8.7735137939453125, 4.3867568969726562, 
2.1933784484863281, 1.0966892242431641, 0.54834461212158203, 
0.27417230606079102, 0.13708615303039551, 0.068543076515197754, 
0.034271538257598877, 0.017135769128799438, 0.0085678845643997192]

In my mapfile I have the following definition :
EXTENT 47860 1620431 1197822 2677441
PROJECTION
  "init=epsg:27572"

In my web page :
var map = new OpenLayers.Map('map', {'maxResolution':'auto', 
projection:'EPSG:27572', maxExtent:  new OpenLayers.Bounds(47860, 1620431, 
1197822, 2677441)});

In my tilecache.cfg

type=WMSLayer
url=http://localhost:81/cgi-bin/mapserv.exe?&map=my.map
layers=mylayer
extension=png
bbox=47860,1620431,1197822,2677441
srs=EPSG:27572

This request works:
http://localhost:81/cgi-bin/tilecache/tilecache.cgi?map=my.map&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&Format=image/png&layers=rfao&bbox=47860,1620431,1197822,2677441


OpenLayer does requests like this that are not working:
http://localhost:81/cgi-bin/tilecache/tilecache.cgi?map=my.map&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&Format=image/png&LAYERS=rfao&STYLES=&EXCEPTIONS=application%2Fvnd.ogc.se_inimage&SRS=EPSG%3A27572&BBOX=47860,2071421.933333,498850.933333,2522412.866667&WIDTH=256&HEIGHT=256

I've done the math and it seems normal that it's not working, the requested 
tile doesn't match.
The problem is that I don't know why OpenLayer ask for these tiles.

If someone have an idea...

Tchule.

_________________________________________________________________
Get a preview of Live Earth, the hottest event this summer - only on MSN 
http://liveearth.msn.com?source=msntaglineliveearthhm




More information about the Tilecache mailing list