[mapserver-users] Difference in appearance between "mode=map"and WMS

Steve Lime Steve.Lime at dnr.state.mn.us
Mon Dec 8 17:53:43 EST 2008


It's not a bug, just a difference in the extent models between MapServer
proper and WMS.
The MapServer WMS interface accounts for this difference in the code by
adjusting the
WMS extent to a MapServer extent. You'd need to make a similar
adjustment when doing
comparisons. A WMS extent is 1/2 a pixel larger all around (cellsize is
the same). The effect
is very subtle and most often not even noticeable.

Steve

>>> On 12/8/2008 at 3:39 PM, in message
<493D9405.7040606 at mapgears.com>,
Julien-Samuel Lacroix <jlacroix at mapgears.com> wrote:
> Hi,
> 
> Did you try the other way around? Making the WMS request with a
square BBOX?
> 
> Mapserver should return a valid image. Maybe others may help, I
remember 
> a bug of a 1 pixel error in some cases, but I don't remember what it
was 
> exactly.
> 
> Julien
> 
> Roger André wrote:
>> Hi Julien,
>> 
>> That makes sense, but it doesn't work.  I modified my mapfile so
that I 
>> now generate a 20_deg x 20_deg tile that is 600_pixels x 600_pixels.
 If 
>> I georeference that image using the extents, I still get incorrect 
>> placement.  Maybe if I choose an output projection which always has

>> square pixels, like spherical mercator (?) this will work.  I'll
give it 
>> a shot.
>> 
>> Is there any way to give a WMS request via mapscript and NOT go
through CGI?
>> 
>> Roger
>> --
>> 
>> 
>> 
>> On Mon, Dec 8, 2008 at 12:25 PM, Julien-Samuel Lacroix 
>> <jlacroix at mapgears.com <mailto:jlacroix at mapgears.com>> wrote:
>> 
>>     Hi,
>> 
>>     I guess would be that the WMS use non-square pixels. So if your
BBOX
>>     x/y  (rectangle in your case) doesn't match you WIDTH/HEIGHT
ratio
>>     (square in your case) the map will appear stretched. MapServer
will
>>     actually stretch the map to fit the extent in the WIDTH/HEIGHT.
>> 
>>     The mode=map don't do that. If your extent doesn't have the
same
>>     ratio, it adds some degree in your extent to fit the size.
>> 
>>     Make sure your BBOX and EXTENT are a square in your requests and
retry
>> 
>> 
>>     Julien
>> 
>>     Roger André wrote:
>> 
>>         Hi All,
>> 
>>         I think I'm having an instance of cranial flatulation, but
maybe
>>         not.  Hopefully you can set me straight.
>> 
>>         I need to create an image with Mapserver using mapscript
that I
>>         can then georeference manually and use in another
application.
>>          It needs to look exactly the same as the image I can
already
>>         generate via a WMS call that looks like this:
>> 
>>         
>
http://localhost/cgi-bin/mapserv?map=/var/www/mapfiles/hydro/hydro.map

>>         &SERVICE=WMS
>>         &version=%221.1.1%22
>>         &REQUEST=GetMap
>>         &LAYERS=imagery
>>         &STYLES=&BBOX=-125,39,-108,54
>>         &WIDTH=600
>>         &HEIGHT=600
>>         &FORMAT=png
>>         &SRS=epsg:4326
>> 
>>         I'm testing my mapscript parameters using a simple
"mode=map"
>>         call to Mapserver, and the results I'm getting so far don't
>>         match the appearance of the WMS output at all.  My mapfile
has
>>         the following extent and projection info in it:
>> 
>>          PROJECTION
>>            "init=epsg:4326"
>>          END
>> 
>>          EXTENT -125.0  39.0 -108.0  54.0
>>          SIZE 600 600
>> 
>>         In addition to the mapfile projection specification, I am
also
>>         specifying the same projection info in each of my LAYERS as
well.
>> 
>>         Is it possible to do what I'm trying to accomplish here?
>> 
>>         Thanks,
>> 
>>         Roger
>>         --
>> 
>> 
>>        
------------------------------------------------------------------------
>> 
>>         _______________________________________________
>>         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 
>> 
>> 
>>     -- 
>>     Julien-Samuel Lacroix
>>     Mapgears
>>     http://www.mapgears.com/ 
>> 
>> 


More information about the mapserver-users mailing list