<span class="gI"><span class="go">@Steve Lime</span></span> : Thank you for the graphic. So if i understand, the map is generated with GDAL, which use the big extent, and the scale and scalebar generated from mapeserver, which calculate it with the small extent.<br>
According to my tests, it generate a 0.1% error in a 1/300000 scale. It&#39;s not bad. But the best would be not have this error.<br><br><br><div class="gmail_quote">2011/2/17 Stephen Woodbridge <span dir="ltr">&lt;<a href="mailto:woodbri@swoodbridge.com">woodbri@swoodbridge.com</a>&gt;</span><br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">I thought there were some extensive discussions on msCalculateScale and this particular issue in the past. I don&#39;t remember if it was on the dev-list or in a ticket. If I recall, it was changed which caused significant regressions and the changed back because of them.<br>

<br>
I&#39;m not opposed to a change, per say, but I would like to avoid the issues we had last time. If this is getting into 6.0, this would be a good departure point to make a backwards compatibility breaking change. But once 6.0 is released, we will need to maintain some compatibility within the 6.x family of releases and not introduce major compatibility issues.<br>

<br>
-Steve W<div class="im"><br>
<br>
On 2/17/2011 10:17 AM, Jan Hartmann wrote:<br>
</div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div class="im">
Interesting. Could this be added to the documentation? It&#39;s important<br>
when you are scaling at pixel level. Would it make sense to add an<br>
option for MapServer to treat extents the same way as GDAL?<br>
<br>
Jan<br>
<br>
On 2011-02-17 16:07, Lime, Steve D (DNR) wrote:<br>
</div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div class="im">
<br>
It’s due to how MapServer interprets extents. It uses a pixel-center<br>
model so you end up using width or height minus one in computations<br>
because<br>
<br>
an extent is from the center of the UL pixel to the center of LR pixel<br>
(you lose the “one” from the outside) . I’ve attached a graphic I<br>
created some time<br>
<br>
ago that illustrates the difference between a MapServer extent and the<br>
model GDAL and WMS use.<br>
<br>
Steve<br>
<br>
*From:*<a href="mailto:mapserver-dev-bounces@lists.osgeo.org" target="_blank">mapserver-dev-bounces@lists.osgeo.org</a><br>
&lt;mailto:<a href="mailto:mapserver-dev-bounces@lists.osgeo.org" target="_blank">mapserver-dev-bounces@lists.osgeo.org</a>&gt;<br>
[mailto:<a href="mailto:mapserver-dev-bounces@lists.osgeo.org" target="_blank">mapserver-dev-bounces@lists.osgeo.org</a>] *On Behalf Of *Mohamed<br>
Saâd HESSANE<br>
*Sent:* Thursday, February 17, 2011 4:41 AM<br></div>
*To:* <a href="mailto:mapserver-dev@lists.osgeo.org" target="_blank">mapserver-dev@lists.osgeo.org</a> &lt;mailto:<a href="mailto:mapserver-dev@lists.osgeo.org" target="_blank">mapserver-dev@lists.osgeo.org</a>&gt;<div class="im">
<br>
*Subject:* [mapserver-dev] Implementation of the msCalculateScale<br>
<br>
Good morning everybody.<br>
I don&#39;t understand how the msCalculateScale function in mapscale.c is<br>
implemented.<br>
As far as I know, the scale is calculated from the relation :<br>
inches_in_screen / inches_in_reallity.<br>
inches_in_screen : depend on the DPI and the width of the map;<br>
inches_in_reality : depend on the map.extent, and the pixel size.<br>
So why the &quot;width-1&quot; at the line 96? For me just &quot;width&quot; is more<br>
correct. Perhaps I&#39;m wrong.<br>
The branches 4.X have just &quot;width&quot; in their implementations (line 125).<br>
So why the center pixel is removed from calculation?<br>
<br>
<br>
_______________________________________________<br>
mapserver-dev mailing list<br>
</div><a href="mailto:mapserver-dev@lists.osgeo.org" target="_blank">mapserver-dev@lists.osgeo.org</a>  &lt;mailto:<a href="mailto:mapserver-dev@lists.osgeo.org" target="_blank">mapserver-dev@lists.osgeo.org</a>&gt;<div class="im">
<br>
<a href="http://lists.osgeo.org/mailman/listinfo/mapserver-dev" target="_blank">http://lists.osgeo.org/mailman/listinfo/mapserver-dev</a><br>
</div></blockquote><div class="im">
<br>
<br>
_______________________________________________<br>
mapserver-dev mailing list<br>
<a href="mailto:mapserver-dev@lists.osgeo.org" target="_blank">mapserver-dev@lists.osgeo.org</a><br>
<a href="http://lists.osgeo.org/mailman/listinfo/mapserver-dev" target="_blank">http://lists.osgeo.org/mailman/listinfo/mapserver-dev</a><br>
</div></blockquote><div><div></div><div class="h5">
<br>
_______________________________________________<br>
mapserver-dev mailing list<br>
<a href="mailto:mapserver-dev@lists.osgeo.org" target="_blank">mapserver-dev@lists.osgeo.org</a><br>
<a href="http://lists.osgeo.org/mailman/listinfo/mapserver-dev" target="_blank">http://lists.osgeo.org/mailman/listinfo/mapserver-dev</a><br>
</div></div></blockquote></div><br>