[Tilecache] too far from tile corner
Shawn Oatley
shawn at niagarafalls.ca
Wed Aug 26 09:15:17 EDT 2009
I had a similar problem in the past and if I recall, it was a matter of specifying the resolution in both the OL constructor and the TC config. Plus, make sure the maxExtent in your OL constructor matches the TC bbox parameter.
Shawn
>>> On 8/26/2009 at 8:21 AM, "Jan van der Ven" <j.vanderven at magion.nl> wrote:
Dear list,
I have a problem with tilecache. My tiles are not rendered because they are not aligned with the grid.
Here is my sample map:
<html xmlns="http://www.w3.org/1999/xhtml" ( http://www.w3.org/1999/xhtml )>
<head>
<title>TileCache</title>
<script src="js/OpenLayers.js"></script>
<!--script type="text/javascript" src="lib/proj4js-compressed.js"></script-->
<script type="text/javascript"
src="http://maps.google.com/maps?file=api&v=2&key=" ( http://maps.google.com/maps?file=api&v=2&key= )></script>
</head>
<body>
<div style="width:100%; height:100%" id="map"></div>
<script defer="defer" type="text/javascript">
biskurl = "http://" ( http:/// ) + window.location.host + "/";
map = new OpenLayers.Map('map',{
projection:'EPSG:900913',
maxResolution:156543.0339,
units:'m',
numZoomLevels:20
});
layerSwitchControl = new OpenLayers.Control.LayerSwitcher();
map.addControl(layerSwitchControl);
var layer = new OpenLayers.Layer.Google( "Satelliet" , {'sphericalMercator':true, type: G_SATELLITE_MAP});
layer.addOptions({
isBaseLayer: true,
buffer: 1,
// without this line I never get out of Africa when zooming in
maxExtent: new OpenLayers.Bounds(-20037508.34,-20037508.34,20037508.34,20037508.34)
});
map.addLayer(layer);
// this seems to do nothing
map.restrictedExtent = new OpenLayers.Bounds(513236.42635, 6779582.22281, 539836.512, 6805952.99756);
// add a tilecache layer
tilelayer = new OpenLayers.Layer.WMS(
'New-tilecache',
'http://example.com/cgi-bin/tilecache-2.10/tilecache.cgi?',
{
layers:'bisk',
format:'image/png'
},
{
isBaseLayer:false,
sphericalMercator:true,
displayOutsideMaxExtent:true // firebug says maxExtent = -180,-90, 180, 90
});
map.addLayer(tilelayer);
map.setCenter(513236, 6779582);
map.zoomTo(12);
</script>
</body>
</html>
And here is the relevant part of tilecache.cfg:
[bisk]
type=MapServerLayer
layers=Nieuw-ms
mapfile=/var/www/bisk/html/maps/a.map
srs=EPSG:900913
extension=png
spherical_mercator=true
And I tried it without any resolutions, with this one:
resolutions=76.43702827148438,38.21851413574219,19.109257067871095,9.554628533935547,4.777314266967774,2.388657133483887,1.1943285667419434,0.5971642833709717,0.29858214168548586,0.14929107084274293
And instead of that with:
maxResolution=156543.0339
But every tile request, such as:
http://example.com/cgi-bin/tilecache-2.10/tilecache.cgi?LAYERS=bisk&FORMAT=image%2Fpng&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&STYLES=&EXCEPTIONS=application%2Fvnd.ogc.se_inimage&SRS=EPSG%3A900913&BBOX=528152.7394125,6780180.1557938,537936.67903125,6789964.0954125&WIDTH=256&HEIGHT=256
returns the error:
An error occurred: Current x value 528152.739413 is too far from tile corner x 528332.738613
Can anyone point me in the right direction?
Kind regards,
Jan
--
Jan H. van der Ven
MAGION Industrial Software Solutions
Wolga 5
2491 BK Den Haag
The Netherlands
Mobile : + 31 (0)6 - 55361734
Phone : +31 (0)70-4442770
Fax : +31 (0)70-4442082
E-mail : j.vanderven at MAGION.nl <mailto:j.vanderven at MAGION.nl>
Web : www.MAGION.nl <http://www.MAGION.nl>
Notice of Confidentiality
This transmission is intended for the named addressee only. It contains information which may be confidential and which may also be privileged. Unless you are the named addressee (or authorised to receive it for the addressee) you may not copy or use it, or disclose it to anyone else. If you have received this transmission in error please notify the sender immediately.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/tilecache/attachments/20090826/08aa73e0/attachment.html
More information about the Tilecache
mailing list