Timeline for How to get legend image from a WMS using PyQgis
Current License: CC BY-SA 3.0
11 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Jun 4, 2018 at 13:38 | history | tweeted | twitter.com/StackGIS/status/1003632026023538688 | ||
May 2, 2018 at 5:55 | answer | added | Sebastian Salazar | timeline score: 2 | |
Mar 2, 2018 at 17:34 | answer | added | nmtoken | timeline score: 4 | |
Mar 2, 2018 at 15:58 | history | edited | George | CC BY-SA 3.0 |
deleted 4 characters in body
|
Mar 2, 2018 at 15:55 | comment | added | George | Thanks for your comment but I think I am not making myself clear. For example if I add this layer using the GUI, QGIS shows automatically the legend on the left side. On the other hand if I go into the python console and type the lines of code updated above. Legend is never shown. Thanks for your help | |
Mar 2, 2018 at 11:14 | history | edited | Ian Turton |
edited tags
|
|
Mar 1, 2018 at 18:50 | comment | added | nmtoken | A WMS may have multiple layers and each layer may have multiple styles each with it's own legend. So do you want to request the appropriate legend using PyQGIS (in which case I can't see any other way than parse the GetCapabilities in PyQGIS as a first step), or if not, what is it you want PyQGIS to do? Construct your own legend based on the pixel values of the image?? | |
Mar 1, 2018 at 17:53 | comment | added | George | Hi, indeed you can do it with a specific GetLegendGraphic request from geoserver, nevertheless I am looking a way of doing it using PyQGIS. The way It is shown on the code above only adds the wms but it dismiss the legend. In the end my objective is to load a WMS with its legend with the PyQGIS API. Hope it helps to clarify the question. | |
Mar 1, 2018 at 16:48 | comment | added | nmtoken | I this a geoserver specific question as per tag, or is it a generic WMS question? Normally I would expect that you would need to parse the GetCapabilities response to find the URL for the legend (normally a GetLegendGraphic request) relevant to the style you have selected for the specific layer. | |
Mar 1, 2018 at 16:44 | history | edited | nmtoken | CC BY-SA 3.0 |
improved formatting, added tags
|
Mar 1, 2018 at 16:42 | history | asked | George | CC BY-SA 3.0 |