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

Tamas Szekeres szekerest at gmail.com
Thu Mar 6 07:49:24 PST 2014


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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapserver-dev/attachments/20140306/c2c26613/attachment.html>


More information about the mapserver-dev mailing list