<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&lt;iostream&gt;<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&lt;&lt;&quot;Enter the xa_length(angular units): &quot;;<br>    cin&gt;&gt;xa_length;<br>    cout&lt;&lt;&quot;Enter the ya_length(angular units): &quot;;<br>    cin&gt;&gt;ya_length;<br>

    float xl_length;<br>    float yl_length;<br>    cout&lt;&lt;&quot;Considering standardized rendering pixel size to be 0.28mm × 0.28mm (millimeters) &quot;&lt;&lt;endl;<br>    cout&lt;&lt;&quot;and radius of earth = 6378137m &quot;&lt;&lt;endl;<br>

    xl_length = (xa_length * (2 * PI * radius))/360;<br>    yl_length = (ya_length * (2 *PI * radius ))/360;<br>    cout&lt;&lt;&quot;map extent is : &quot; &lt;&lt; xl_length &lt;&lt; &quot;m  x &quot; &lt;&lt;yl_length&lt;&lt;&quot; m &quot;&lt;&lt;endl;<br>

    cout&lt;&lt;&quot; Enter the x_pixels (no. of pixels on horizontal axis) &quot;;<br>    cin&gt;&gt;x_pixels;<br>    cout&lt;&lt;&quot; Enter the y_pixels (no. of pixels on vertical axis) &quot;;<br>    cin&gt;&gt;y_pixels;<br>

    std_scale_dr = ((xl_length / x_pixels)/ standard);<br>    cout&lt;&lt;&quot;standard scale denominator will be : &quot;&lt;&lt; std_scale_dr&lt;&lt;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&#39;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>