Bug report #5602

Identify disabled in WMS for grouped layers

Added by michele zanolli over 12 years ago. Updated over 8 years ago.

Status:Closed
Priority:Normal
Assignee:-
Category:Web Services clients/WMS
Affected QGIS version:master Regression?:No
Operating System: Easy fix?:No
Pull Request or Patch supplied:No Resolution:wontfix
Crashes QGIS or corrupts data:No Copied to github as #:15175

Description

I have a WMS service (mapserver) like this:

-group1
--layer1
--layer2
--layer3

If I open separately layer1, layer2 and layer3 --> I can Identify features
If I select layer1, layer2 and layer3 as a single layer in QGIS --> I can identify features
If I select group1 as a single layer in QGIS --> QGIS does not let me identify the features (the identify tool is disaled)

Why? If I use other WMS clients I can identify group1 as a normal WMS layer
(Maybe it is not a bug, but a feature to be implemented)

History

#1 Updated by Giovanni Manghi over 12 years ago

what platform and qgis version?

#2 Updated by Giovanni Manghi over 12 years ago

  • Status changed from Open to Feedback

#3 Updated by michele zanolli over 12 years ago

tested on:
- ubuntu 10.04 + qgis trunk
- win xp + qgis 1.7.4
- win server 2003 + qgis 1.7.4
- win 7 + qgis 1.7.4

All the same behaviour

#4 Updated by Jürgen Fischer over 12 years ago

  • Status changed from Feedback to Open

#5 Updated by Paolo Cavallini about 12 years ago

  • Target version set to Version 2.0.0

#6 Updated by Jürgen Fischer over 10 years ago

  • Category set to GUI

#7 Updated by Jürgen Fischer over 10 years ago

  • Category changed from GUI to Web Services clients/WMS

#8 Updated by Giovanni Manghi over 10 years ago

  • Target version changed from Version 2.0.0 to Future Release - Nice to have

#9 Updated by Jürgen Fischer over 10 years ago

  • Status changed from Open to Feedback

not reproducable - works fine for me.

#10 Updated by michele zanolli over 10 years ago

here an example of mapserver (6.4.1) mapfile not working for me:

MAP
    NAME "test_wms" 
    EXTENT 648300 5090700 677500 5116000
    UNITS meters
    MAXSIZE 10000
    IMAGECOLOR 255 255 255
    RESOLUTION 96
    CONFIG "PROJ_LIB" "/usr/local/share/proj/" 

    PROJECTION
        "init=epsg:25832" 
    END

    WEB
        METADATA
            "wms_title"                     "test_wms" 
            "wms_onlineresource"            "http://localhost/cgi-bin/mapserv?map=test_wms.map&" 
            "wms_srs"                       "EPSG:25832" 
            "wms_feature_info_mime_type"    "text/plain" 
            "wms_abstract"                  "Abstract" 
            "wms_enable_request"            "*" 
        END
        IMAGEPATH "/tmp/" 
    END

    LAYER
        NAME "polygon_layer" 
        CONNECTIONTYPE postgis
        CONNECTION "dbname=mydb host=localhost" 
        DATA "wkb_geometry FROM polygon_layer" 
        EXTENT 648300 5090700 677500 5116000
        GROUP test_wms
        TYPE POLYGON
        STATUS OFF
        SYMBOLSCALEDENOM 2000
        TEMPLATE void
        MINSCALEDENOM 50
        METADATA
            "wms_title"                     "polygon_layer" 
            "wms_enable_request"            "*" 
        END
        CLASS
            NAME "polygon layer" 
            STYLE
                WIDTH 3
                OUTLINECOLOR 255 0 255
                LINECAP butt
                PATTERN 8 4 END
            END
        END
    END

    LAYER
        NAME "line_layer" 
        CONNECTIONTYPE postgis
        CONNECTION "dbname=mydb host=localhost" 
        DATA "wkb_geometry FROM line_layer" 
        EXTENT 648300 5090700 677500 5116000
        GROUP test_wms
        TYPE LINE
        STATUS OFF
        TEMPLATE void
        SYMBOLSCALEDENOM 1000
        MINSCALEDENOM 50
        METADATA
            "wms_title"                     "line_layer" 
            "wms_enable_request"            "*" 
        END
        CLASS
            NAME "line layer" 
            STYLE
                COLOR 255 0 0
                LINECAP butt
                WIDTH 2
                PATTERN 6 6 END
            END
        END
    END

    LAYER
        NAME "point_layer" 
        CONNECTIONTYPE postgis
        CONNECTION "dbname=mydb host=localhost" 
        DATA "wkb_geometry FROM point_layer" 
        EXTENT 648300 5090700 677500 5116000
        GROUP test_wms
        TYPE POINT
        STATUS OFF
        TEMPLATE void
        SYMBOLSCALEDENOM 1000
        MINSCALEDENOM 50
        METADATA
            "wms_title"                     "point_layer" 
            "wms_enable_request"            "*" 
        END
        CLASS
            NAME "point layer" 
            STYLE
                COLOR 0 0 0
                SYMBOL "circle" 
                SIZE 8
            END
        END
    END

END

#11 Updated by Giovanni Manghi over 10 years ago

  • Status changed from Feedback to Open

#12 Updated by Médéric RIBREUX almost 9 years ago

  • Status changed from Open to Feedback

Hello, bug triage...

I can't reproduce it on QGIS 2.13 master on BRGM WMS services on http://geoservices.brgm.fr/geologie . When I group 3 WMS layers on a single QGIS layer, I can use identify tool.

Can you confirm you don't have the bug with your previous configuration ?

#13 Updated by Giovanni Manghi almost 9 years ago

  • Resolution set to not reproducable
  • Status changed from Feedback to Closed

closing for lack of feedback, reopen if necessary.

#14 Updated by michele zanolli almost 9 years ago

  • Status changed from Closed to Reopened

Médéric RIBREUX wrote:

Hello, bug triage...

I can't reproduce it on QGIS 2.13 master on BRGM WMS services on http://geoservices.brgm.fr/geologie . When I group 3 WMS layers on a single QGIS layer, I can use identify tool.

Can you confirm you don't have the bug with your previous configuration ?

Hello Médéric,
what you are saying is correct, but my issue is a bit different: in your WMS example http://geoservices.brgm.fr/geologie try to open the WMS layer GEOLOGIE (id = 1). It is an aggregate of more layers. Can you identify that group? My Identify tool is greyed out

#15 Updated by Jukka Rahkonen almost 9 years ago

The reason is that in the GetCapabilities document that Mapserver creates the group layer is not marked as queryable. I hit the same issue yesterday when I tried to cascade WMS from Mapserver with Geoserver https://lists.osgeo.org/pipermail/mapserver-users/2016-January/078538.html.
I would say that QGIS works as supposed and the bug is on the Mapserver side.

#16 Updated by michele zanolli almost 9 years ago

Thanks for the explanation, I agree with you. Only a precisation: if the WMS Client queries the group layer - even if it is not marked as queryable - mapserver responds correctly with GetFeatureInfo response.

#17 Updated by Jukka Rahkonen almost 9 years ago

Yes, but it seems to require that every individual layer in the group is queryable. If one layer in not queryable Mapserver turns the whole group non-queryable.

#18 Updated by Giovanni Manghi almost 9 years ago

  • Status changed from Reopened to Closed

Jukka Rahkonen wrote:

Yes, but it seems to require that every individual layer in the group is queryable. If one layer in not queryable Mapserver turns the whole group non-queryable.

so it still seems something that depends on server configurations, right? please reopen of necessary.

#19 Updated by michele zanolli almost 9 years ago

Jukka Rahkonen wrote:

Yes, but it seems to require that every individual layer in the group is queryable. If one layer in not queryable Mapserver turns the whole group non-queryable.

In the Médéric's WMS example (http://geoservices.brgm.fr/geologie) if you try to open the 5 layers inside the group BSS (BSS_SEMIS_2, BSS_SEMIS_1, BSS_SEMIS_0, BSS_TOTAL_AVEC_LABEL, BSS_TOTAL_SANS_LABEL) they are all queryable. If you open the group BSS that contains those layers (id=19), it is not queryable

#20 Updated by Giovanni Manghi almost 9 years ago

  • Resolution deleted (not reproducable)
  • Status changed from Closed to Reopened

michele zanolli wrote:

Jukka Rahkonen wrote:

Yes, but it seems to require that every individual layer in the group is queryable. If one layer in not queryable Mapserver turns the whole group non-queryable.

In the Médéric's WMS example (http://geoservices.brgm.fr/geologie) if you try to open the 5 layers inside the group BSS (BSS_SEMIS_2, BSS_SEMIS_1, BSS_SEMIS_0, BSS_TOTAL_AVEC_LABEL, BSS_TOTAL_SANS_LABEL) they are all queryable. If you open the group BSS that contains those layers (id=19), it is not queryable

#21 Updated by Giovanni Manghi almost 9 years ago

Giovanni Manghi wrote:

michele zanolli wrote:

Jukka Rahkonen wrote:

Yes, but it seems to require that every individual layer in the group is queryable. If one layer in not queryable Mapserver turns the whole group non-queryable.

In the Médéric's WMS example (http://geoservices.brgm.fr/geologie) if you try to open the 5 layers inside the group BSS (BSS_SEMIS_2, BSS_SEMIS_1, BSS_SEMIS_0, BSS_TOTAL_AVEC_LABEL, BSS_TOTAL_SANS_LABEL) they are all queryable. If you open the group BSS that contains those layers (id=19), it is not queryable

so it needs futher tests.

#22 Updated by Jukka Rahkonen almost 9 years ago

I need to clarify:

- With Mapserver group layer is never announced as queryable in the GetCapabilities
- However, if all the layers in the group are queryable, it is possible to to query the group by making a GetFeatureInfo request with &QUERY_LAYERS=group (but QGIS does not know that)
- If at least one layer in the group is not queryable then the group in not queryable either and GetFeatureInfo with &QUERY_LAYERS=group will yield an exception from Mapserver.

This behaviour makes it tricky to program a workaround on QGIS side. QGIS should check that the WMS server is Mapserver with some heuristics, and if it is, then check if all the layers in the group are queryable. If they are the group is queryble as well. Brute force approach would be just to fire GetFeatureInfo always - if layer or group is not queryable the server will tell it by sending an exception.

I think that this is not a bug in QGIS and the right place to fix the issue is on the Mapserver side.

#23 Updated by Giovanni Manghi almost 9 years ago

  • Status changed from Reopened to Feedback

#24 Updated by Giovanni Manghi over 8 years ago

  • Resolution set to wontfix
  • Status changed from Feedback to Closed

I think that this is not a bug in QGIS and the right place to fix the issue is on the Mapserver side.

closing for lack of feedback. Please reopen if necessary.

Also available in: Atom PDF