[mapserver-users] calculating min / max scaledenom based on projection

Lime, Steve D (MNIT) steve.lime at state.mn.us
Thu May 11 13:21:32 PDT 2017


Scale should be SRS independent in most cases shouldn’t it? The exception being something like epsg:4326 where ground distance varies by latitude. With epsg:4326 MapServer has two options:


-          The default is using a constant decimal degrees to inches value, I think it’s based at the equator (for better or worse).

-          There’s a compile-time option called ENABLE_VARIABLE_INCHES_PER_DEGREE that will use a value computed from the latitude at the center of a view.

Steve

From: mapserver-users [mailto:mapserver-users-bounces at lists.osgeo.org] On Behalf Of Travis Kirstine
Sent: Tuesday, May 09, 2017 9:38 AM
To: mapserver-users at lists.osgeo.org
Subject: [mapserver-users] calculating min / max scaledenom based on projection

Hi all,

We've been using mapserver as a WMS server and need to determine (outside of mapserver) if a requested image contains layers defined in the getmap request based on the layers min/maxscaledenom setting in the mapfile.  If a request to the WMS is in the MAP SRS then we simply calculate the image scale using a method like the one used in the mapscale.c msCalculateScale and compare it to the MaxScaleDenom defined in the GetCapabilities and everything works as expected.

The issue we have is that if the WMS GetMap SRS projection does not match the native projection of the layer the maxscaledenom will vary.  For example if the layers is in web mercator projection and has a maxscaledenom of 25000 but the request is made in EPSG:4326 geographic the layer will not be drawn above a scale of ~ 1:16000 in QGIS.

How can I calculate what 25000 equals for other SRSs?

How does mapserver calculate the min/max scaledenom for various projections / units?

Thanks
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20170511/cbb28cd9/attachment.html>


More information about the mapserver-users mailing list