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

Rahkonen Jukka Jukka.Rahkonen at mmmtike.fi
Wed Oct 19 03:54:42 PDT 2011


One more thought:

If you will get the mask layer to work and if you have something valuable to hide on the bottom layer then I would suggest you to spend some time for investigating if some advanced user could fool you. It might be possible to make the mask layer transparent with SLD or SLD_BODY styling, or with Mapserver CGI controls. Read http://mapserver.org/cgi/controls.html and modify the example 
Example 2, changing a presentation style:
...&map.layer[lakes].class[0].style[0]=SYMBOL+crosshatch+COLOR+151+51+151+SIZE+15&...

and try to adjust opacity. Study if there are some means for preventing the use of CGI controls and report your findings back.

-Jukka Rahkonen-


> -----Alkuperäinen viesti-----
> Lähettäjä: mapserver-users-bounces at lists.osgeo.org 
> [mailto:mapserver-users-bounces at lists.osgeo.org] Puolesta 
> John Cartwright
> Lähetetty: 19. lokakuuta 2011 6:12
> Vastaanottaja: mapserver-users at lists.osgeo.org
> Aihe: Re: [mapserver-users] WMS GetMap request - incorrect 
> layer ordering
> 
> Thank you both for your suggestions, but I can't seem to get 
> this to work either w/ shp2img or a WMS request.  I've 
> configured the layers as:
> 
> LAYER
>   NAME countries
>   TYPE POLYGON
>   STATUS on
>   ...  
> END
> 
> LAYER
>   NAME mask
>   TYPE POLYGON
>   STATUS on
>   REQUIRES "[countries]"
> ...
> END
> 
> Then requesting 
> 
> 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
> 
> shows the countries layer unmasked.  Explicitly adding the 
> mask to the request as below displays the countries layer 
> masked, but is not a solution for me as I have to enforce the mask.
> 
> 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,mask&format=png
> 
> 
> The debugging log suggests that only the countries layer is 
> being requested:
> 
> [Tue Oct 18 21:00:20 2011].525713 msDrawMap(): rendering 
> using outputformat named png (AGG/PNG).
> [Tue Oct 18 21:00:20 2011].525903 msDrawMap(): WMS/WFS set-up 
> and query, 0.000s
> [Tue Oct 18 21:00:20 2011].537968 msDrawMap(): Layer 1 
> (countries), 0.012s
> [Tue Oct 18 21:00:20 2011].537982 msDrawMap(): Drawing Label 
> Cache, 0.000s
> [Tue Oct 18 21:00:20 2011].537989 msDrawMap() total time: 0.013s
> [Tue Oct 18 21:00:20 2011].555843 msSaveImage(stdout) total 
> time: 0.018s
> [Tue Oct 18 21:00:20 2011].555881 mapserv request processing 
> time (msLoadMap not incl.): 0.031s
> [Tue Oct 18 21:00:20 2011].555888 msFreeMap(): freeing map at 
> 0x100832600.
> 
> Did I misunderstand what you intended?
> 
> Thanks again!
> 
> --john
> 
> 
> 
> 
> On Oct 18, 2011, at 8:06 AM, Daniel Morissette wrote:
> 
> > On 11-10-18 04:36 AM, Rahkonen Jukka wrote:
> >> Hi,
> >> It is also possible to create a mask layer with REQUIRES 
> keywork. The
> >> snippet below will make the "mask" layer to draw always when the
> >> "countries" layer is drawn. However, it is not 
> automatically drawn if
> >> you ask for any other layer. One minory drawback is that 
> the mask layer
> >> is also listed in the GetCapabilities as a normal WMS layer.
> >> LAYER
> >> NAME "mask"
> >> ....
> >> REQUIRES "[countries]"
> >> ...
> >> END
> > 
> > Great suggestion. And with MapServer 6.x you can hide the 
> mask layer from the GetCapabilities using the 
> "ows_enable_request" metadata:
> > 
> > LAYER
> >  NAME "mask"
> >  ....
> >  REQUIRES "[countries]"
> >  METADATA
> >    "ows_enable_request" "!GetCapabilities"
> >    ...
> >  END
> >  ...
> >  END
> > 
> > -- 
> > Daniel Morissette
> > http://www.mapgears.com/
> > Provider of Professional MapServer Support since 2000
> > 
> > _______________________________________________
> > 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
> 


More information about the MapServer-users mailing list