[Tilecache] too far from tile corner
Jan van der Ven
j.vanderven at magion.nl
Thu Aug 27 02:37:56 EDT 2009
Hi Shawn,
Thanks for the quick reply. I followed your suggestion, but the error is the
same.
Christopher Schmidt told me in the #openlayers that I should not have
maxExtent at all, but then I get stuck in Africa, when I try to zoom to
Europe. So that is why I added the whole world as a maxExtent.
Do you have another suggestion?
Kind regards,
Jan
_____
From: Shawn Oatley [mailto:shawn at niagarafalls.ca]
Sent: Wednesday, August 26, 2009 15:15
To: j.vanderven at magion.nl; tilecache at openlayers.org
Subject: Re: [Tilecache] too far from tile corner
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
<http://maps.google.com/maps?file=api&v=2&key=> &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.5546285
33935547,4.777314266967774,2.388657133483887,1.1943285667419434,0.5971642833
709717,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
<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=appl
ication%2Fvnd.ogc.se_inimage&SRS=EPSG%3A900913&BBOX=528152.7394125,6780180.1
557938,537936.67903125,6789964.0954125&WIDTH=256&HEIGHT=256>
&FORMAT=image%2Fpng&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&STYLES=&EXCEPTI
ONS=application%2Fvnd.ogc.se_inimage&SRS=EPSG%3A900913&BBOX=528152.7394125,6
780180.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.
No virus found in this incoming message.
Checked by AVG - www.avg.com
Version: 8.5.392 / Virus Database: 270.13.67/2326 - Release Date: 08/25/09
18:07:00
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/tilecache/attachments/20090827/c467e6e5/attachment.html
More information about the Tilecache
mailing list