[mapserver-dev] Regarding to the scale calculation in MapServer

Andrea Peri aperi2007 at gmail.com
Fri Mar 7 03:23:09 PST 2014


In a client wms as qgis or openlayer.
How is comute the scale ?

I guess adopt a method matematically correct but that is more different
from the client (qgis , openlayer and so on)
could give an understandable to the user.
Because is ask to its wms client

"go to the 1:10.000"

the client computed the box and send the request to the mapserver.

But for the mapserver the scale is not 1:10.000 but other value.
This could be more confusing for the user ?

my 2 ct.

Andrea.



2014-03-07 10:33 GMT+01:00 Tamas Szekeres <szekerest at gmail.com>:

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



-- 
-----------------
Andrea Peri
. . . . . . . . .
qwerty àèìòù
-----------------
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapserver-dev/attachments/20140307/1f3bc317/attachment.html>


More information about the mapserver-dev mailing list