[mapserver-users] How to set queryable=1 for a GROUP layer?

Even Rouault even.rouault at spatialys.com
Tue Jan 12 07:11:29 PST 2016


Le mardi 05 janvier 2016 11:42:55, Rahkonen Jukka (MML) a écrit :
> Hi,
> 
> It seems the for Mapserver the group is queryable if all the layers in the
> group are queryable. Having one non-queryable layer in the group makes the
> whole group non-queryable. Geoserver used to do the same but now it does
> the opposite: if at least one layer in the group is queryable then the
> group is as well. https://osgeo-org.atlassian.net/browse/GEOS-7293
> 
> If user makes GetFeatureInfo request for such mixed layer Geoserver is
> sending results from the queryable layers without sending exceptions about
> non-queryable layers. This is very user and admin friendly behavior but
> probably difficult to implement in Mapserver. Perhaps we could still get
> the queryable attribute? Logic should correspond with the current
> implementation: if every layer in the group and in the subgroups is
> queryable, set queryable="1", otherwise set queryable="0".
> 
> There seems to be a related QGIS issue https://hub.qgis.org/issues/5602.

Proposed implementation:
https://github.com/mapserver/mapserver/pull/5220

> 
> -Jukka Rahkonen-
> 
> Lime, Steve D wrote:
> 
> 
> Looking at mapwms.c it doesn't look like it. The code that outputs basic
> groups just outputs a plain <Layer> tag (L3345) with no attributes. It
> does look like that, at least for simple groups, it could be possible to
> do what you're asking by adding a private isGroupQueryable() function that
> would call msIsLayerQueryable() whenever a layer's group name matches the
> target and would return true accordingly. Not sure how that would work
> with subgroup support though.
> 
> Steve
> 
> From: mapserver-users [mailto:mapserver-users-bounces at lists.osgeo.org] On
> Behalf Of Rahkonen Jukka (MML) Sent: Monday, January 04, 2016 9:44 AM
> To: Mapserver-Users
> (mapserver-users at lists.osgeo.org<mailto:mapserver-users at lists.osgeo.org>)
> <mapserver-users at lists.osgeo.org<mailto:mapserver-users at lists.osgeo.org>>
> Subject: [mapserver-users] How to set queryable=1 for a GROUP layer?
> 
> Hi,
> 
> I have a layer group, let's say "group_1", where all the sub-layers are
> queryable.  The group layer is also effectively queryable and
> GetFeatureInfo works if I use &QUERY_LAYERS=group_1. The problem is that
> the group layer is not announced announced as queryable in the
> GetCapabilities
> 
> <Layer>
> <Name> group_1</Name>
> <Title> group_1</Title>
> ...
>        <Layer queryable="1" opaque="0" cascaded="0">
>        <Name> sub_layer</Name>
>     ....
> 
> 
> I would like to see it as:
> <Layer queryable="1">
> <Name> group_1</Name>
> <Title> group_1</Title>
> ....
>           <Layer queryable="1" opaque="0" cascaded="0">
>           <Name> sub_layer</Name>
>           ....
> 
> 
> Without queryable attribute I can't make GetFeatureInfo to work when I am
> cascading it with Geoserver. By reading the WMS 1.1.1 standard I feel that
> GeoServer is behaving as it is supposed to work: if the layer is not
> announced to be queryable then it is not queryable. I can't find any
> mention in the WMS standard that a group layer should behave in a
> different way than the normal layers.
> 
> 7.1.4.6 Layer Attributes
> A <Layer> may have zero or more of the following XML attributes: queryable,
> cascaded, opaque, noSubsets, fixedWidth, fixedHeight. All of these
> attributes are optional and default to 0
> 
> 7.1.4.6.1 Queryable layers
> A Layer is said to be "queryable" if the server supports the GetFeatureInfo
> operation on that Layer. A server may support GetFeatureInfo on some of
> its layers but not on all. A server shall issue a Service Exception
> (code="LayerNotQueryable") if GetFeatureInfo is requested on a Layer that
> is not queryable.
> 
> Is there any way to add the queryable="1" attribute to a layer group?
> 
> -Jukka Rahkonen-

-- 
Spatialys - Geospatial professional services
http://www.spatialys.com



More information about the MapServer-users mailing list