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

Roger André randre at gmail.com
Mon Dec 8 17:28:00 PST 2008


Hi Adam and Steve,

Thanks very much for the advice.  The thing is, the shift I'm seeing is way
more than 1/2 pixel on the edges.  I'm off by quite a few degrees actually.
I suspect it's as Julien thought earlier: I'm specifying an image size that
is not consistent with the geographic extents.  So I get back the number of
pixels I've requested, but force a larger area than want.  I guess what I'm
looking for is WMS logic, but without having to make a WMS request.

Thanks again,

Roger
--


On Mon, Dec 8, 2008 at 5:20 PM, Adam Ryan <adamdryan at gmail.com> wrote:

> 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
> >
> _______________________________________________
> mapserver-users mailing list
> 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/20081208/7a9be16e/attachment.htm>


More information about the MapServer-users mailing list