[mapserver-dev] Implementation of the msCalculateScale

Stephen Woodbridge woodbri at swoodbridge.com
Thu Feb 17 11:14:20 EST 2011


I thought there were some extensive discussions on msCalculateScale and 
this particular issue in the past. I don't remember if it was on the 
dev-list or in a ticket. If I recall, it was changed which caused 
significant regressions and the changed back because of them.

I'm not opposed to a change, per say, but I would like to avoid the 
issues we had last time. If this is getting into 6.0, this would be a 
good departure point to make a backwards compatibility breaking change. 
But once 6.0 is released, we will need to maintain some compatibility 
within the 6.x family of releases and not introduce major compatibility 
issues.

-Steve W

On 2/17/2011 10:17 AM, Jan Hartmann wrote:
> 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
>
>
> _______________________________________________
> mapserver-dev mailing list
> mapserver-dev at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/mapserver-dev



More information about the mapserver-dev mailing list