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

Rahkonen Jukka Jukka.Rahkonen at mmmtike.fi
Wed Oct 19 02:37:45 PDT 2011


Hi,

I spent several hours with blind eyes before having a coffee break and now I really hope that it is this easy: Change the mask layer to STATUS DEFAULT.

Logic is: Draw the mask layer always (STATUS DEFAULT) but because of REQUIRES only if the condition is fulfilled. Mask should not appear with your other layers.

-Jukka Rahkonen-


John Cartwright wrote:
> 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