[mapserver-users] PHP-mapscript before/after draw discrepancy

Steve Lime sdlime at gmail.com
Wed Sep 28 20:40:40 PDT 2011


Extents are adjusted to deal with the fact the supplied extent often
doesn't match the aspect ratio of the output image. One set of
coordinates (x's or y's) is left alone and the other is adjusted to
compensate for the image aspect ratio. By default MapServer likes
square pixels.

I don't know enough to about the zoompoint/zoomrect methods to really
comment on why they don't work well with the non-square pixels, except
that non-square pixels are really a WMS/WCS phenomena in MapServer...

Steve

On Wed, Sep 28, 2011 at 7:08 PM, Shorthouse, David <dshorthouse at eol.org> wrote:
> On Wed, Sep 28, 2011 at 5:51 PM, Cristiano Sumariva <sumariva at gmail.com> wrote:
>> Well after reading the discussion in the link I guess you need to implement
>> double msAdjustExtent(rectObj *rect, int width, int height) mapserver
>> function in your language
>> and update size then the extent on map object using the mapscript API.
>
> Thanks for the response Christiano. Indeed, I *might* be able to
> pre-calculate what the eventual extent will be after the draw() method
> as Tamas suggested, assuming I don't bungle the logic. However, this
> feels backward, especially since I have to design a front-end to
> compensate for it. Why is the extent being mysteriously (read
> inaccessibly) adjusted in the the first place?
>
> David P. Shorthouse
>
>> 2011/9/28 Shorthouse, David <dshorthouse at eol.org>
>>>
>>> I am using PHP-mapscript and am bumping into this old issue:
>>>
>>> http://osgeo-org.1803224.n2.nabble.com/Mapscript-extent-prediction-td1991453.html,
>>> which is now a show-stopper for me.
>>>
>>> I tried using CONFIG 'MS_NONSQUARE' 'yes', which does *initially*
>>> produce an extent after draw precisely the same as provided with
>>> setExtent. However, my application also make heavy use of zoompoint
>>> and zoomrectangle, which no longer work as expected after having set
>>> this CONFIG.
>>>
>>> Anyone have any suggestions on how to get an extent that is precisely
>>> the same before and after the draw method?
>>>
>>> Thanks in advance,
>>>
>>> David P. Shorthouse
>>> _______________________________________________
>>> mapserver-users mailing list
>>> mapserver-users at lists.osgeo.org
>>> http://lists.osgeo.org/mailman/listinfo/mapserver-users
>>
>>
> _______________________________________________
> mapserver-users mailing list
> mapserver-users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/mapserver-users
>



More information about the MapServer-users mailing list