[mapserver-dev] Implementation of the msCalculateScale

Jan Hartmann j.l.h.hartmann at uva.nl
Thu Feb 17 10:17:57 EST 2011


Interesting. Could this be added to the documentation? It's important 
when you are scaling at pixel level. Would it make sense to add an 
option for MapServer to treat extents the same way as GDAL?

Jan

On 2011-02-17 16:07, Lime, Steve D (DNR) wrote:
>
> It's due to how MapServer interprets extents. It uses a pixel-center 
> model  so you end up using width or height minus one in computations 
> because
>
> an extent is from the center of the UL pixel to the center of LR pixel 
> (you lose the "one" from the outside) . I've attached a graphic I 
> created some time
>
> ago that illustrates the difference between a MapServer extent and the 
> model GDAL and WMS use.
>
> Steve
>
> *From:*mapserver-dev-bounces at lists.osgeo.org 
> [mailto:mapserver-dev-bounces at lists.osgeo.org] *On Behalf Of *Mohamed 
> Saâd HESSANE
> *Sent:* Thursday, February 17, 2011 4:41 AM
> *To:* mapserver-dev at lists.osgeo.org
> *Subject:* [mapserver-dev] Implementation of the msCalculateScale
>
> Good morning everybody.
> I don't understand how the msCalculateScale function in mapscale.c is 
> implemented.
> As far as I know, the scale is calculated from the relation : 
> inches_in_screen / inches_in_reallity.
> inches_in_screen : depend on the DPI and the width of the map;
> inches_in_reality : depend on the map.extent, and the pixel size.
> So why the "width-1" at the line 96? For me just "width" is more 
> correct. Perhaps I'm wrong.
> The branches 4.X have just "width" in their implementations (line 125).
> So why the center pixel is removed from calculation?
>
>
> _______________________________________________
> mapserver-dev mailing list
> mapserver-dev at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/mapserver-dev
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/mapserver-dev/attachments/20110217/e56731d3/attachment.html


More information about the mapserver-dev mailing list