[Tilecache] Re: tilecache problem with LABELMAXSCALEDENOM

mojtabajml jamali.mojtaba at gmail.com
Mon Jan 31 06:43:12 EST 2011


I write a php function for compute:

<?php
function get_resolutions($scales, $units)
{
    $dpi = 72.0;
    $factor = array('inches'=> 1.0, 'ft'=> 12.0, 'mi'=> 63360.0, 'm'=>
39.3701,'km'=> 39370.1, 'dd'=> 4374754.0);
   
    $inches = 1 / $dpi;
    $monitor_l = $inches / $factor[$units];
   
    $resolutions = '';
	foreach($scales as $scale)
	{
		$real_l = $monitor_l * intval($scale);
		$resolutions .= sprintf( '%.17f , ' , $real_l );
	}
    return $resolutions ;
}
$scales = array(2000,1900,1800,1700,1600,1500,1400,130,1200,1100
				,1000,900,800,700,600,500,400,300,200,100);
echo get_resolutions($scales,'m');
?>
/////////////////
the output is:
0.70555517455576122 , 0.67027741582797318 , 0.63499965710018502 ,
0.59972189837239698 , 0.56444413964460893 , 0.52916638091682089 ,
0.49388862218903284 , 0.04586108634612448 , 0.42333310473345670 ,
0.38805534600566866 , 0.35277758727788061 , 0.31749982855009251 ,
0.28222206982230447 , 0.24694431109451642 , 0.21166655236672835 ,
0.17638879363894031 , 0.14111103491115223 , 0.10583327618336417 ,
0.07055551745557612 , 0.03527775872778806 

in Mapfile I modify RESOLUTION to 0.70555517455576122 and in openlayers and
tilecache.cfg set maxResolution=0.70555517455576122

but I have yhis error:
An error occurred: can't find resolution index for 0.035278. Available
resolutions are: 
[0.70555517455576122, 0.35277758727788061, 0.17638879363894031,
0.088194396819470153, 0.044097198409735076, 0.022048599204867538,
0.011024299602433769, 0.0055121498012168845, 0.0027560749006084423,
0.0013780374503042211, 0.00068901872515211057, 0.00034450936257605528,
0.00017225468128802764, 8.6127340644013821e-05, 4.3063670322006911e-05,
2.1531835161003455e-05, 1.0765917580501728e-05, 5.3829587902508638e-06,
2.6914793951254319e-06, 1.345739697562716e-06]


-- 
View this message in context: http://osgeo-org.1803224.n2.nabble.com/tilecache-problem-with-LABELMAXSCALEDENOM-tp5972374p5976859.html
Sent from the TileCache mailing list archive at Nabble.com.


More information about the Tilecache mailing list