When MapServer forces square pixels, it does so with msAdjustExtent() in maputil.c:759
If MapServer tries to force square pixels depends on how it is called and how it is configured. For starters, see the MS_NONSQUARE configuration option. And if I remember correctly, MapServer doesn't force square pixels with WMS requests. On 10/01/2015 03:22 PM, Zach Chehayeb wrote: > 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.cheha...@airborne.aero<mailto:zach.cheha...@airborne.aero> > Tel No. +1 949 707 1800 > www.airborne.aero > > [New Small2] > > > > From: Basques, Bob (CI-StPaul) [mailto:bob.basq...@ci.stpaul.mn.us] > Sent: Thursday, October 01, 2015 12:29 PM > To: Zach Chehayeb > Cc: mapserver-users@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.cheha...@airborne.aero<mailto:zach.cheha...@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.cheha...@airborne.aero<mailto:zach.cheha...@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@lists.osgeo.org<mailto:mapserver-users@lists.osgeo.org> > http://lists.osgeo.org/mailman/listinfo/mapserver-users > > > > _______________________________________________ > mapserver-users mailing list > mapserver-users@lists.osgeo.org > http://lists.osgeo.org/mailman/listinfo/mapserver-users
_______________________________________________ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users