[OpenLayers-Dev] Difficulties while using TileCache with exotic projection (EPSG:32188) with a WMS layer.

Kevin Emamirad keyone at gmail.com
Mon Jun 18 16:13:48 EDT 2007


This time I've tried with this element from the GetCapabilities:

<EX_GeographicBoundingBox>
	<westBoundLongitude>-74.33856907697769</westBoundLongitude>
	<eastBoundLongitude>-73.12357922656163</eastBoundLongitude>
	<southBoundLatitude>45.225980636601356</southBoundLatitude>
	<northBoundLatitude>45.970535756854986</northBoundLatitude>
</EX_GeographicBoundingBox>

So I have calculated my resolutions like this
-73,1236-(-74,3386)=1.215
1.215/1*256 ... 1.215/2*256... ...

[1] 0.004746094,
[2] 0.002373047,
[3] 0.001582031,
[4] 0.001186523,
[5] 0.000949219,
[6] 0.000791016,
[7] 0.000678013,

So now my tilecache.cfg is like this:

[montreal]
type=WMSLayer
url=http://demo3.kheops-tech.com:8080/mtlwms/wms?
layers=Topographie
extension=png
size=256,256
bbox=-74.3386,45.2260,-73.1236,45.9705
srs=EPSG:32188
levels=7
resolutions=0.004746094,0.002373047,0.001582031,0.001186523,0.000949219,0.000791016,0.000678013,0.000593262,0.000527344,0.000474609,0.000431463,0.000395508,0.000365084,0.000339007,0.000316406,0.000296631,0.000279182,0.000263672,0.000249794,0.000237305

  <script defer="defer" type="text/javascript">

	var min_x = 264875.54;
	var min_y = 5028255.89;
	var max_x = 311635.16;
	var max_y = 5065756.95;

	var map = new OpenLayers.Map( $('map'),
	{maxExtent: new OpenLayers.Bounds(min_x,min_y,max_x,max_y),
maxResolution: 0.004746094 ,projection: "EPSG:32188"});
    var wms = new OpenLayers.Layer.WMS( "wms",
	"http://localhost:8080/TileCache", {layers: 'montreal', format: "image/png"});
    map.addLayer(wms);
	if (!map.getCenter()) map.zoomToMaxExtent();
	
  </script>

When I'm loading a tile I have this exception:

Exception: couldn't calculate tile index for layer montreal from
([288254.571231, 5047006.985988, 288255.786232, 5047008.200988])

Then if I remove the maxExtent like this:
	var map = new OpenLayers.Map( $('map'),
		{maxResolution: 0.004746094 ,projection: "EPSG:32188"});
		
Exception: couldn't calculate tile index for layer montreal from
([-1.394991, -0.089995, -0.179991, 1.125005])

Now I don't understand this array ! where are these number coming from?

By the way, We uploaded on Internet the world map which I talked on my
first message:
http://demo3.kheops-tech.com:8080/TileCache/index.html

I have also tried

  <script defer="defer" type="text/javascript">

	var min_x = -74.3386;
	var min_y = -73.1236;
	var max_x = 45.2260;
	var max_y = 45.9705;

	var map = new OpenLayers.Map( $('map'),
	{maxExtent: new OpenLayers.Bounds(min_x,min_y,max_x,max_y),
maxResolution: 0.004746094 ,projection: "EPSG:32188"});
    var wms = new OpenLayers.Layer.WMS( "wms",
	"http://localhost:8080/TileCache", {layers: 'montreal', format: "image/png"});
    map.addLayer(wms);
	if (!map.getCenter()) map.zoomToMaxExtent();
	
  </script>

  The result was:

  Exception: couldn't calculate tile index for layer montreal from
([-16.018597, -13.588597, -14.803597, -12.373597])

	
Thanks again for your help,

Kevin Emamirad



More information about the Dev mailing list