Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[QGIS Server][WMS] getLegend - Raster layers values not showed in legend #55651

Closed
2 tasks
vprint opened this issue Dec 18, 2023 · 1 comment · Fixed by #56026
Closed
2 tasks

[QGIS Server][WMS] getLegend - Raster layers values not showed in legend #55651

vprint opened this issue Dec 18, 2023 · 1 comment · Fixed by #56026
Assignees
Labels
Bug Either a bug report, or a bug fix. Let's hope for the latter! Server Related to QGIS server

Comments

@vprint
Copy link

vprint commented Dec 18, 2023

What is the bug or the crash?

this URL : http://localhost:8081/cgi-bin/qgis_mapserv.fcgi.exe?/wms&SERVICE=WMS&VERSION=1.3.0&REQUEST=GetLegendGraphic&FORMAT=image%2Fpng&LAYER=SVF&LAYERS=SVF&WIDTH=100&BOXSPACE=0&TRANSPARENT=true&SYMBOLHEIGHT=25&LAYERTITLE=false&RULELABEL=false give me the following png
legend_png.

But if i try te get legend in JSON format like this : http://localhost:8081/cgi-bin/qgis_mapserv.fcgi.exe?/wms&SERVICE=WMS&VERSION=1.3.0&REQUEST=GetLegendGraphic&FORMAT=application%2Fjson&LAYER=SVF&LAYERS=SVF&WIDTH=100&BOXSPACE=0&TRANSPARENT=true&SYMBOLHEIGHT=25&LAYERTITLE=false&RULELABEL=false i got this simple json : {"nodes":[{"symbols":[{"title":" "},{"title":""}],"title":"","type":"layer"}],"title":""}. Min and max values are not showed.

Steps to reproduce the issue

  1. Create qgis project with raster layers
  2. Publish qgis project
  3. Try a wms getLegend over the raster layer

Versions

qgis 3.34

Supported QGIS version

  • I'm running a supported QGIS version according to the roadmap.

New profile

Additional context

No response

@vprint vprint added the Bug Either a bug report, or a bug fix. Let's hope for the latter! label Dec 18, 2023
@agiudiceandrea agiudiceandrea added the Server Related to QGIS server label Dec 19, 2023
@elpaso elpaso self-assigned this Jan 26, 2024
elpaso added a commit to elpaso/QGIS that referenced this issue Jan 26, 2024
@elpaso
Copy link
Contributor

elpaso commented Jan 26, 2024

Fixed with #56026 but the output is not ideal: that legend is built upon two different items: the first contains just the title of the band and the second contains the color ramp icon and information.

The JSON output is now:

{
   "nodes":[
      {
         "symbols":[
            {
               "title":"Band 1 (Red)"
            },
            {
               "icon":"iVBORw0K...........",
               "max":255,
               "min":1,
               "title":""
            }
         ],
         "title":"bluemarble",
         "type":"layer"
      }
   ],
   "title":""
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Either a bug report, or a bug fix. Let's hope for the latter! Server Related to QGIS server
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants