[mapserver-users] WMS GetMap request - incorrect layer ordering

Matt McClelland matt at wildwalks.com
Sun Oct 16 19:18:46 EDT 2011


My understanding is that the order you list the WMS layers is the order in
which they will be layed down

Try adding
   GROUP "default"
to the layers you want displayed

then use &layers=default in you WMS call.

Hope that helps.

Matt  :)

On Mon, Oct 17, 2011 at 7:28 AM, Rahkonen Jukka
<Jukka.Rahkonen at mmmtike.fi>wrote:

> Hi,
>
> Somehow I feel that using STATUS DEFAULT layers with WMS is against the
> idea of the standard which has obviously been that user gets exactly those
> layers which are ordered from the service with &layers=.   Configuring
> server to always send some layers may be useful sometimes but righ now I
> cannot imagine when. Can you give a few examples?
>
> -Jukka Rahkonen-
>
> John Cartwright wrote:
>
>  > Thanks for your reply Jukka.  The reason for the single layer in the WMS
> request is that the other layer has a
>  > "STATUS default" which I understood to mean that it was always returned
> regardless of the value in the WMS
>  > layers parameter.  Indeed this has been my experience,  problem is that
> the default layer is always at the
>  > bottom of the draw order.
>
> --john
>
> On Oct 15, 2011, at 10:54 AM, Rahkonen Jukka wrote:
>
> > Hi,
> >
> > You had only one layer in your WMS request but I suppose it was just an
> accident. Layers in WMS request should be respected so that the first layer
> goes to the bottom and next ones above it. Order in the mapfile should not
> matter. I can't say about your installation but it seems to behave correctly
> for me with Mapserver 6.0
> > Compare this one with toilets first in the request
> >
> http://188.64.1.61/cgi-bin/mapserv?map=/usr/map/osm-mapserver_i.map&REQUEST=GetMap&SERVICE=WMS&VERSION=1.1.1&WIDTH=459&HEIGHT=353&LAYERS=POI_toilet%2Cdefault&TRANSPARENT=TRUE&FORMAT=image%2Fpng&BBOX=436293.7193914731,6903411.337404243,436601.3555717845,6903647.929063611&SRS=EPSG:3067&STYLES=
> > and this with toilets last
> >
> http://188.64.1.61/cgi-bin/mapserv?map=/usr/map/osm-mapserver_i.map&REQUEST=GetMap&SERVICE=WMS&VERSION=1.1.1&WIDTH=459&HEIGHT=353&LAYERS=default%2CPOI_toilet&TRANSPARENT=TRUE&FORMAT=image%2Fpng&BBOX=436293.7193914731,6903411.337404243,436601.3555717845,6903647.929063611&SRS=EPSG:3067&STYLES=
> >
> > -Jukka Rahkonen-
> > ________________________________________
> > Lähettäjä: mapserver-users-bounces at lists.osgeo.org [
> mapserver-users-bounces at lists.osgeo.org] k&#228;ytt&#228;j&#228;n John
> Cartwright [john.c.cartwright at comcast.net] puolesta
> > Lähetetty: 15. lokakuuta 2011 19:02
> > Vastaanottaja: mapserver-users at lists.osgeo.org
> > Aihe: [mapserver-users] WMS GetMap request - incorrect layer ordering
> >
> > Hello All,
> >
> > I'm finding a difference between the image produced by shp2img and a WMS
> GetMap request.  The image produced by shp2img looks as I expect honoring
> the order in which LAYERS are defined in the map file and the STATUS value.
>  However, the WMS request does not seem to respect the order of the LAYERs,
> always drawing the polygons first regardless of the order defined in the map
> file or that of the WMS LAYERS request parameter.
> >
> > Here's a representative WMS request:
> >
> >
> http://localhost/cgi-bin/basicworld?request=getmap&service=wms&width=500&height=250&bbox=-180,-90,180,90&srs=EPSG:4326&version=1.1.1&layers=countries&format=png
> >
> > Both the cities and countries layers display as you'd expect, but the
> countries draw on top of the cities contrary to what I'd expect and
> different that in the shp2img output.
> >
> > I'm using mapserver version 6.0.1 and I've tried various versions of WMS.
>  Can someone please examine the map file below and point out what I'm doing
> wrong?
> >
> > Thanks!
> >
> > --john
> >
> >
> > MAP
> >   NAME basicworld
> >   SIZE 720 360
> >   EXTENT -180 -90 180 90
> >   UNITS DD
> >   SHAPEPATH "/Users/jcc/shapefiles"
> >   IMAGETYPE PNG
> >
> >        WEB
> >      IMAGEPATH "/Library/WebServer/Documents/output"
> >      IMAGEURL "/output/"
> >
> >      METADATA
> >         "ows_title" "BasicWorld Server"
> >         "ows_onlineresource" "http://localhost/cgi-bin/basicworld?"
> ##required
> >         "ows_srs" "EPSG:4326"
> >         "ows_onlineresource"   "http://localhost/cgi-bin/basicworld?"
>  ## Recommended
> >        "ows_enable_request" "*"
> >      END
> >   END
> >
> >   PROJECTION
> >      "init=epsg:4326"   ##required
> >   END
> >
> >   SYMBOL
> >      NAME 'circle'
> >      TYPE ELLIPSE
> >      POINTS 1 1 END
> >      FILLED TRUE
> >   END
> >
> > LAYER
> >        NAME countries
> >        TYPE POLYGON
> >        STATUS on
> >        DATA "country"
> >        CLASS
> >                OUTLINECOLOR 0 0 0
> >                COLOR 167 167 167
> >        END
> > END  # layer
> >
> > LAYER
> >        NAME cities
> >        TYPE POINT
> >        STATUS default
> >        DATA "cities"
> >        CLASS
> >                SYMBOL 'circle'
> >                SIZE 6
> >                COLOR 204 153 255
> >        END
> > END  # layer
> >
> > END # Map File_______________________________________________
> > 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/20111017/d02a2194/attachment.html


More information about the mapserver-users mailing list