[mapserver-dev] Implementation of the msCalculateScale
Lime, Steve D (DNR)
Steve.Lime at state.mn.us
Thu Feb 17 10:18:38 EST 2011
I'll create a ticket to do so. When MapServer was originally written there was a companion program for imagery (imgserv) that
was implemented using the Erdas Imagine C toolkit. I followed their lead at the time and it's stuck...
"Would it make sense to add an option for MapServer to treat extents the same way as GDAL?" Sure, it's called WMS...
Steve
From: Jan Hartmann [mailto:j.l.h.hartmann at uva.nl]
Sent: Thursday, February 17, 2011 9:18 AM
To: Lime, Steve D (DNR)
Cc: Mohamed Saâd HESSANE; mapserver-dev at lists.osgeo.org
Subject: Re: [mapserver-dev] Implementation of the msCalculateScale
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> [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<mailto: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<mailto: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/97ad8558/attachment.html
More information about the mapserver-dev
mailing list