<div dir="ltr">Thomas,<div><br></div><div>It is indeed a problem that the scale may vary across a given view, but with the current approach in most cases the reported scale is not falling between the minimum and the maximum, which seems to be incorrect. It would me more reasonable to use something like what Paul is mentioning with the <span style="color:rgb(0,0,0);font-family:Helvetica,Arial;font-size:13.142857551574707px">great circle distance calculation.</span></div>
<div><span style="color:rgb(0,0,0);font-family:Helvetica,Arial;font-size:13.142857551574707px"><br></span></div><div><span style="color:rgb(0,0,0);font-family:Helvetica,Arial;font-size:13.142857551574707px">Best regards,</span></div>
<div><span style="color:rgb(0,0,0);font-family:Helvetica,Arial;font-size:13.142857551574707px"><br></span></div><div><span style="color:rgb(0,0,0);font-family:Helvetica,Arial;font-size:13.142857551574707px">Tamas</span></div>
<div><span style="color:rgb(0,0,0);font-family:Helvetica,Arial;font-size:13.142857551574707px"><br></span></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">2014-03-07 10:19 GMT+01:00 Thomas Bonfort <span dir="ltr"><<a href="mailto:thomas.bonfort@gmail.com" target="_blank">thomas.bonfort@gmail.com</a>></span>:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Tamas,<br>
Adding to what Paul said about the need to maintain a list of<br>
projections with their respective deformations (which can be dependant<br>
of longitude also, not only latitude), introducing extent based scale<br>
calculation also implies that your map rendering may change drastically<br>
(by switching from one scale-delimited layer to the next) by just having<br>
the user do a 1-pixel pan in the vertical direction. This would also be<br>
incompatible with any tiling software as the content of a given tile<br>
will depend on many external factors (the size of a metatile being one)<br>
and will therefore not be consistent with a neighboring tile.<br>
<br>
If you went that way, how would you account for the fact that the scale<br>
at the top of an image is different from the scale at the bottom of it?<br>
<br>
Maybe you can work-around your specific need by having a scale<br>
computation function given a projection, size and extent, and then using<br>
that programmatically to select which layers/styles you need.<br>
But in terms of the scaledenom usage in mapserver, it should stay as it<br>
is now (and ENABLE_VARIABLE_INCHES_PER_DEGREE left disabled by default).<br>
<br>
Best regards,<br>
thomas<br>
<div class="HOEnZb"><div class="h5"><br>
On 06/03/2014 16:49, Tamas Szekeres wrote:<br>
> Hi Devs,<br>
><br>
> As far as I know certain projections require to modify the scale regarding<br>
> to the latitude of the given view. For latlong and AFAIK for the web<br>
> mercator (ie EPSG:3857, EPSG:900913) we might require to use cos(latitude)<br>
> as the correction factor.<br>
><br>
> With the current mapserver code, I don't see how this requirement is taken<br>
> into account. For the units=MS_DD, I can see the following code fragment in<br>
> the code in msInchesPerUnits (though this is not compiled in by default)<br>
><br>
> #ifdef ENABLE_VARIABLE_INCHES_PER_DEGREE<br>
>       if (center_lat != 0.0) {<br>
>         double cos_lat;<br>
>         cos_lat = cos(MS_PI*center_lat/180.0);<br>
>         lat_adj = sqrt(1+cos_lat*cos_lat)/sqrt(2.0);<br>
>       }<br>
> #endif<br>
><br>
><br>
> Shouldn't the correction be applied for the web mercator (units=MS_METERS)<br>
> and probably for futher CRS-s as well?<br>
><br>
> Should we anyway have ENABLE_VARIABLE_INCHES_PER_DEGREE defined by default?<br>
><br>
> Best regards,<br>
><br>
> Tamas<br>
><br>
><br>
><br>
</div></div><div class="HOEnZb"><div class="h5">> _______________________________________________<br>
> mapserver-dev mailing list<br>
> <a href="mailto:mapserver-dev@lists.osgeo.org">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>
><br>
_______________________________________________<br>
mapserver-dev mailing list<br>
<a href="mailto:mapserver-dev@lists.osgeo.org">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></div>