[mapserver-dev] Implementation of the msCalculateScale

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


Not sure if the ticket is just for the documentation or also for the 
program option. I would like to have the option for native MapServer 
too: I find it easier to use for map layout than WMS SLD. I always 
considered the MapServer parser the best thing of MapServer.

Jan

On 2011-02-17 16:18, Lime, Steve D (DNR) wrote:
>
> 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/7bf7a3fc/attachment-0001.html


More information about the mapserver-dev mailing list