[Tilecache] too far from tile corner
Shawn Oatley
shawn at niagarafalls.ca
Thu Aug 27 08:37:41 EDT 2009
Hi Jan,
I recall similar issues of getting stuck in Africa. Back then, there was a lot of different things I was trying so I can't pinpoint exactly what did it for me. Here are my OL map options:
options = {
projection: new OpenLayers.Projection("EPSG:26917"),
maxExtent: new OpenLayers.Bounds(640541.774843334, 4755587.40501464, 667085.402317306, 4779623.23729788),
units: "m",
tileSize: new OpenLayers.Size(256, 256),
resolutions: [850, 425, 212.5, 106.25, 53.125, 26.5625, 13.28125, 6.640625, 3.3203125, 1.66015625, 0.830078125, 0.4150390625, 0.20751953125, 0.103759765625, 0.0518798828125],
....... controls, themes, etc...
};
Then, for TileCache:
[wmsLayer]
type=WMS
url=http://wmsUrl
layers=layerName
extension=png
mime_type=image/png
resolutions=850,425,212.5,106.25,53.125,26.5625,13.28125,6.640625,3.3203125,1.66015625,0.830078125,0.4150390625,0.20751953125,0.103759765625,0.0518798828125
bbox=640541.774843334, 4755587.40501464, 667085.402317306, 4779623.23729788
metaTile=true
metaSize=7,7
srs=EPSG:26917
Perhaps try putting your own values in place of resolutions,bbox, maxextent and projection/srs to see what happens.
Shawn
>>> On 8/27/2009 at 2:37 AM, "Jan van der Ven" <j.vanderven at magion.nl> wrote:
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&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.
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/40dfec2d/attachment.html
More information about the Tilecache
mailing list