<div dir="ltr">Hi,<br><br>I am currently working on Scale Calculation for Non-metric SRS, I went through the manual link at <a href="http://www.mapbender.org/User_talk:Abhishek#Scale_calculation_for_non-metric_SRS">http://www.mapbender.org/User_talk:Abhishek#Scale_calculation_for_non-metric_SRS</a> . I had implemented that in c++<br>
<br>#include<iostream><br>using namespace std;<br><br>#define PI 3.1416<br>#define radius 6378137<br>#define standard 0.00028<br><br>int main()<br>{<br> float xa_length;<br> float ya_length;<br> float x_pixels;<br>
float y_pixels;<br> float std_scale_dr;<br> cout<<"Enter the xa_length(angular units): ";<br> cin>>xa_length;<br> cout<<"Enter the ya_length(angular units): ";<br> cin>>ya_length;<br>
float xl_length;<br> float yl_length;<br> cout<<"Considering standardized rendering pixel size to be 0.28mm × 0.28mm (millimeters) "<<endl;<br> cout<<"and radius of earth = 6378137m "<<endl;<br>
xl_length = (xa_length * (2 * PI * radius))/360;<br> yl_length = (ya_length * (2 *PI * radius ))/360;<br> cout<<"map extent is : " << xl_length << "m x " <<yl_length<<" m "<<endl;<br>
cout<<" Enter the x_pixels (no. of pixels on horizontal axis) ";<br> cin>>x_pixels;<br> cout<<" Enter the y_pixels (no. of pixels on vertical axis) ";<br> cin>>y_pixels;<br>
std_scale_dr = ((xl_length / x_pixels)/ standard);<br> cout<<"standard scale denominator will be : "<< std_scale_dr<<endl;<br> return 0;<br> }<br><br>Now the next step for me is to understand what is going on in file mapbender/http/javascripts/map_obj.js in the functions getScale , checkScale and repaintScale and thereafter implement the above sample code's functionality in the aforesaid file.<br>
<br>But currently I am having problem with getScale function variables.I am stating some of my questions below:<br><br>1 . why is lat_from = ((parseFloat(bbox[3]) - parseFloat(bbox[1]) / 2) * Math.PI) / 180 <br><br>2 . why actually we are dividing by 2 parseFloat(bbox[1])<br>
<br>3 . Please explain the underlying reason for this var lat_to = ((parseFloat(bbox[3]) - parseFloat(bbox[1]) / 2 + pxLeny) * Math.PI) / 180;<br><br>4 . Even though the number of longitudes is twice the number of latitudes but still the formula for both of them are the same<br>
<br>5 . Please explain dist = 6371229 * Math.acos(Math.sin(lat_from) * Math.sin(lat_to) + Math.cos(lat_from) * Math.cos(lat_to) * Math.cos(lon_from - lon_to))<br><br>6 . what does mb_resolution and scale refer to? please explain the expression scale = (dist / Math.SQRT2) * (mb_resolution * 100)<br>
<br>7 . please explain xtenty = parseFloat(bbox[3]) - parseFloat(bbox[1]) and scale = (xtenty / this.getHeight()) * (mb_resolution * 100)<br> <br><br clear="all">Thanks,<br><br>Abhishek Kumar Singh<br>BE/1349/2007<br>
Information Technology<br>6th SEMESTER<br>BIT MESRA<br>
</div>