[mapserver-users] How do a GetFeatureInfo on a group layers

Eichner, Andreas - SID-NLKM Andreas.Eichner at sid.sachsen.de
Mon Jul 30 01:33:11 PDT 2012


wms_layer_group

    Description: (Optional) Can be used to assign a layer to a number of
hierarchically nested groups. This grouped hierarchy will be expressed
in the capabilities.

    WMS_LAYER_GROUP is different from the GROUP keyword in that it does
not publish the name of the group in the capabilities, only the title.
As a consequence the groups set with WMS_LAYER_GROUP can not be
requested with a GetMap or GetFeatureInfo request (see section 7.1.4.5.2
of the WMS implementation specification version 1.1.1. (OGC 01-068r2)).
Another difference is that GROUP does not support nested groups. The
purpose of this metadata setting is to enable making a WMS client aware
of layer grouping.

    All group names should be preceded by a forward slash (/). It is not
allowed to use both the WMS_LAYER_GROUP setting and the GROUP keyword
for a single layer.


> The GetFeatureInfo now work.
> But as a indesiderable secondary effect is disappeared the 
> Group-name from the getcapabilities.
> 
> There is some workaround to add a group-name to the getcapabilities ?

Yes, see http://mapserver.org/ogc/wms_server.html#layer-object-metadata:

wms_layer_group: [...] WMS_LAYER_GROUP is different from the GROUP
keyword in that it does not publish the name of the group in the
capabilities, only the title. As a consequence the groups set with
WMS_LAYER_GROUP can not be requested with a GetMap or GetFeatureInfo
request [...]

Use the GROUP keyword on all and a wms_group_title (and optionally
wms_group_abstract) metadata on one of the layers corresponding to that
group. So it should become something like that

 LAYER 
    GROUP "rt_cat.idcatbdfog"
    NAME "rt_cat.idcatbdfog.ar"
    STATUS DEFAULT
    TYPE POLYGON
    DATA '/path-to-data/shapefile'
    PROJECTION
      "init=epsg:3003"
    END
    METADATA
      ...
      "ows_include_items" "all"
      wms_group_title "The rt_cat.idcatbdfog group"
	wms_group_abstract "This group is intented to show all layers
that belong to rt_cat.idcatbdfog"
    END
    TEMPLATE 'void'
[...]

This should hopefully work as you want. Greets.


More information about the mapserver-users mailing list