[mapserver-users] Understanding extents and resolutions

Zach Chehayeb zach.chehayeb at airborne.aero
Thu Oct 1 13:22:16 PDT 2015


Bob,

I am not sure I am understanding your response correctly. Are you suggesting that it is the coordinate window ratio that determines whether mapserver locks on the east/west or north/south bounds? If so, this doesn’t align with my observations below as all the images where sent the exact same coordinate window but pad on a different axis.

I plan to do the computation to match up exactly as you have suggested but I want to be sure that I correctly understand the logic that mapserver uses to decide which axis to pad so I can apply the computations to the correct axis. I have to maintain backward compatibility in my application and need to accurately assess the actual extent drawn.

Regards,

Zach Chehayeb
Application Developer
Email. zach.chehayeb at airborne.aero<mailto:zach.chehayeb at airborne.aero>
Tel No.  +1 949 707 1800
www.airborne.aero

[New Small2]



From: Basques, Bob (CI-StPaul) [mailto:bob.basques at ci.stpaul.mn.us]
Sent: Thursday, October 01, 2015 12:29 PM
To: Zach Chehayeb
Cc: mapserver-users at lists.osgeo.org
Subject: Re: [mapserver-users] Understanding extents and resolutions

Zach,

If I’m understanding your question correctly, MapServer will always give you your requested coordinate space inside of the requested image size, by buffering the image results along the axis that is larger than the coordinate window needs to draw completely.  In other words, MapServer automatically pads the output image to fill in those areas, East/West and North/South edges based on the coordinate space requested.

If you need them to match up exactly, then you need to do the computations in your application to make the correct requests and make the coordinate window ratio match the pixel window (image size) ratios.

bobb



On Oct 1, 2015, at 2:13 PM, Zach Chehayeb <zach.chehayeb at airborne.aero<mailto:zach.chehayeb at airborne.aero>> wrote:

Hello All,

Can anyone explain or point me in the right direction on how mapserver logic works when a requested map extent cannot be produced at the requested resolution with square pixels?

I am using mapserver in an application that requests mapserver to produce various map extents at various resolutions. The map config is set to not allow non square pixel (so the MS_NONSQUARE setting is set to no).  The application currently assumes that the extent height should always be half of the width. Of course, with MS_NONSQUARE set to no and producing resolutions where the height is not always exactly half of the width, mapserver is unable to produce the exact extents requested. As such, mapserver compensates by extending either the north and south or east and west bounds of the map. See images in link below for a detailed illustration (the red box indicates the requested extent). For all images below, the requested extent is  x1=-58.615527, y1=50.434875, x2=-13.615527, y2=72.934875, but the actual extents differ.

From my observations, it seems that there are three cases. I have included a link below where a zip file that has examples of the cases can be downloaded.
https://www.dropbox.com/s/dy1cgmt8lmbl3wf/Example%20Images.zip?dl=0
1.      The requested resolution height is greater than half of the width (1280x720).
a.      Result: MapServer locks on the East and West bounds and extends the North and South bounds of the map.
2.      The requested resolution height is less than half of the width (960x400).
a.      Result: MapServer locks on the North and South bounds and extends the East and West bounds.
3.      The requested resolution height is half of the width (1000x500).
a.      Result: MapServer produces the image at the requested resolution.

Is anyone able to confirm that these are the only three cases or correct my understanding (if there is more to it than I have described)?

Some info about my installation:
1.      MapServer version 6.0.3 OUTPUT=GIF OUTPUT=PNG OUTPUT=JPEG SUPPORTS=PROJ SUPPORTS=AGG SUPPORTS=FREETYPE SUPPORTS=ICONV SUPPORTS=FRIBIDI SUPPORTS=WMS_SERVER SUPPORTS=WMS_CLIENT SUPPORTS=WFS_SERVER SUPPORTS=WFS_CLIENT SUPPORTS=FASTCGI SUPPORTS=THREADS INPUT=OGR INPUT=GDAL INPUT=SHAPEFILE

Please let me know if there is any other information needed.

Thanks in advance,

Zach Chehayeb
Application Developer
Email. zach.chehayeb at airborne.aero<mailto:zach.chehayeb at airborne.aero>
Tel No.  +1 949 707 1800
www.airborne.aero<x-msg://46/www.airborne.aero>

<image001.jpg>




_______________________________________________
mapserver-users mailing list
mapserver-users at lists.osgeo.org<mailto:mapserver-users at lists.osgeo.org>
http://lists.osgeo.org/mailman/listinfo/mapserver-users

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20151001/9f99a961/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image001.gif
Type: image/gif
Size: 2443 bytes
Desc: image001.gif
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20151001/9f99a961/attachment.gif>


More information about the MapServer-users mailing list