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: fixed width of 200 px of cascaded WMS layer legends #57422

Open
1 of 2 tasks
danceb opened this issue May 14, 2024 · 2 comments · May be fixed by #58790
Open
1 of 2 tasks

QGIS Server: fixed width of 200 px of cascaded WMS layer legends #57422

danceb opened this issue May 14, 2024 · 2 comments · May be fixed by #58790
Assignees
Labels
Bug Either a bug report, or a bug fix. Let's hope for the latter! Feedback Waiting on the submitter for answers Server Related to QGIS server

Comments

@danceb
Copy link

danceb commented May 14, 2024

What is the bug or the crash?

Hi there,

I came across #42063 and yippie, getting the legend of cascaded WMS layer is working again after a long time!

While testing this, I have discovered, that the resulting legend image of the requested layer has always a max width value of 200 px.
This does not make sense in my opinion, as it leads to labels which are to small to read, especially if the legend graphic of the original layer is much wider than 200 px.

So where is this value come from and why is it there?

My suggestion would be to just cascade the width and height of the original layer legend here instead of setting a fixed value.

Thanks for any reply!

Steps to reproduce the issue

  1. Setting up a QGIS project to publish via QGIS Server
  2. include a WMS layer from an external OGC service
  3. publish the project via QGIS Server
  4. Request the legend image of the external wms layer with a GetLegendGraphic-Request

Versions

3.34.6

Supported QGIS version

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

New profile

Additional context

No response

@danceb danceb added the Bug Either a bug report, or a bug fix. Let's hope for the latter! label May 14, 2024
@elpaso elpaso added the Server Related to QGIS server label May 14, 2024
@elpaso
Copy link
Contributor

elpaso commented Sep 17, 2024

Can you please provide a test project with the not-working cascading WMS?
This would spare us the time to search and find a suitable example.

@elpaso elpaso added the Feedback Waiting on the submitter for answers label Sep 17, 2024
@elpaso elpaso self-assigned this Sep 17, 2024
@danceb
Copy link
Author

danceb commented Sep 18, 2024

Hey, @elpaso, thanks a lot for reaching out to this issue!

Here is an example project, with two cascaded WMS services:
example_map.zip

This is a GetLegend request to the service from the project with a cascaded wms layer:
https://kartenportal.jena.de/api/v1/legend/stadtplan?SERVICE=WMS&VERSION=1.3.0&REQUEST=GetLegendGraphic&LAYER=Flaechen&FORMAT=image/png&STYLE=default&SLD_VERSION=1.1.0

And in comparison this requests shows the legend of the original non cascaded layer:
https://kartenportal.jena.de/api/v1/legend/stadtplan_flae?SERVICE=WMS&VERSION=1.3.0&REQUEST=GetLegendGraphic&LAYER=stadtplan_flae&FORMAT=image/png&STYLE=default&SLD_VERSION=1.1.0

elpaso added a commit to elpaso/QGIS that referenced this issue Sep 18, 2024
Fix qgis#57422 by adjusting the legend size considering the
cascaded legend imag size.
elpaso added a commit to elpaso/QGIS that referenced this issue Sep 18, 2024
Fix qgis#57422 by adjusting the legend size considering the
cascaded legend imag size.
@elpaso elpaso linked a pull request Sep 18, 2024 that will close this issue
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! Feedback Waiting on the submitter for answers Server Related to QGIS server
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants