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

Adam Ryan adamdryan at gmail.com
Mon Dec 8 20:20:49 EST 2008


Roger,

I don't know if this would help, but I recently came across a similar
problem which was fixed by adding the processing directive to the
layer:

PROCESSING "RESAMPLE=NEAREST"

This fixed a problem when zooming in very close on a raster layer.
Apparently without this, mapserver changes the extent so that whole
source pixels are included and not split.

More here...

http://www.nabble.com/Raster-alignment-problem-td19900625.html

Cheers,

Adam

On Mon, Dec 8, 2008 at 2:33 PM, Kralidis,Tom [Ontario]
<Tom.Kralidis at ec.gc.ca> wrote:
>
> Roger: you can use MapScript WxS http://mapserver.gis.umn.edu/docs/howto/wxs_mapscript as an approach to run a WMS request via mapscript.  Maybe that can work for you?
>
> ..Tom
>
>
>
> -----Original Message-----
> From: mapserver-users-bounces at lists.osgeo.org on behalf of Roger André
> Sent: Mon 08-Dec-08 16:21
> To: Julien-Samuel Lacroix
> Cc: mapserver-users at lists.osgeo.org
> Subject: Re: [mapserver-users] Difference in appearance between "mode=map" andWMS
>
> 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> 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
>>> http://lists.osgeo.org/mailman/listinfo/mapserver-users
>>>
>>
>> --
>> Julien-Samuel Lacroix
>> Mapgears
>> http://www.mapgears.com/
>>
>
> _______________________________________________
> 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