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

WMS: GetFeatureInfo FEATURE_COUNT set connection default #57180

Merged
merged 6 commits into from
Apr 29, 2024

Conversation

elpaso
Copy link
Contributor

@elpaso elpaso commented Apr 18, 2024

Allow to set a default FEATURE_COUNT (default 10) individually for each WMS connection.

This default also works when adding WMS layers from the browser and it can be overridden for each individual layer when added from the datasource manager.

The deafult user experience when adding layers from the datasource manager is not changed: the default of 10 still applies unless it is explicitly set from the connection settings.

Fix #45206

immagine

Funded by: QGIS user group Germany (QGIS Anwendergruppe Deutschland e.V.)

Allow to set a default FEATURE_COUNT (default 10) individually for
each WMS connection.

This default also works when adding WMS layers from the browser and it
can be overridden for each individual layer when added from the
datasource manager.

The deafult user experience when adding layers from the datasource
manager is not changed: the default of 10 still applies unless it
is explicitly set from the connection settings.

Fix qgis#45206

Founded by: QGIS user group Germany (QGIS Anwendergruppe Deutschland e.V.)
@elpaso elpaso added the Bug Either a bug report, or a bug fix. Let's hope for the latter! label Apr 18, 2024
@github-actions github-actions bot added this to the 3.38.0 milestone Apr 18, 2024
Copy link
Contributor

@pathmapper pathmapper left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

Noticed two things while testing this:

For an existing connection, QGIS Browser settings shows the default 10 but there is no FEATURE_COUNT parameter used in the requests.

For a new layer (added via QGIS Browser):

When changing FEATURE_COUNT to 33 in Data Source Manager:

In QGIS Browser it shows server default

@elpaso
Copy link
Contributor Author

elpaso commented Apr 19, 2024

Thank you!

Noticed two things while testing this:

For an existing connection, QGIS Browser settings shows the default 10 but there is no FEATURE_COUNT parameter used in the requests.

Yeah, my original intention was to keep the original behavior in case the default was not set explicitly (server default) but then I changed the default to 10, I'll update the logic accordingly.

For a new layer (added via QGIS Browser):

When changing FEATURE_COUNT to 33 in Data Source Manager:

In QGIS Browser it shows server default

I think this is expected: we now have two places where this (max) featureCount is defined and they are supposed to work in a cascading way (from the connection to the individual layer definition), by changing the value in the layer datasource manager select dialog you are not changing the connection level default (this is also why I added "Default" to the label btw) but the modifications only apply to the layers being added.

To change the default value you need to edit the connection settings.

I hope this makes sense, I simplified the code anyway and removed the default prefix, 10 is the default in any case if there is no stored setting.

Please have a look to the changes.

@pathmapper
Copy link
Contributor

pathmapper commented Apr 19, 2024

Thanks for sharing your thoughts and updates.

The behaviour in QGIS Browser is now as expected for new and existing connections.

When connecting to the same connection in Data Source Manager, the value for FEATURE_COUNT is the same as in Browser, that's fine.

What's unexpected (at least for me :-) ) is, that when setting a new value for FEATURE_COUNT in Data Source Manager it's not used when a layer is added from there (screencast below, 11 is set in Data Source Manager, but 88 is used for the connection.)

IMHO the feature-count connection setting should be updated here to 11 and this value should be used when adding a layer.

Peek.2024-04-19.16-44.mp4

@elpaso
Copy link
Contributor Author

elpaso commented Apr 19, 2024

Thanks for sharing your thoughts and updates.

What's unexpected (at least for me :-) )

You are right, it should be fixed by c23aaa4

@pathmapper
Copy link
Contributor

it should be fixed by c23aaa4

It is, thank you!

@elpaso elpaso merged commit fcec63d into qgis:master Apr 29, 2024
30 checks passed
@elpaso elpaso deleted the bugfix-gh45206-wms-feature-count branch April 29, 2024 11:17
@DelazJ DelazJ added Feature Needs Documentation When merging a labeled PR, an issue will be created in the Doc repo. Changelog Items that are queued to appear in the visual changelog - remove after harvesting labels Apr 29, 2024
@qgis-bot
Copy link
Collaborator

@elpaso

This pull request has been tagged for the changelog.

  • The description will be harvested so please provide a "nearly-ready" text for the final changelog
  • If possible, add a nice illustration of the feature. Only the first one in the description will be harvested (GIF accepted as well)
  • If you can, it's better to give credits to your sponsor, see below for different formats.

You can edit the description.

Format available for credits
  • Funded by NAME
  • Funded by URL
  • Funded by NAME URL
  • Sponsored by NAME
  • Sponsored by URL
  • Sponsored by NAME URL

Thank you!

@qgis-bot
Copy link
Collaborator

@elpaso
This pull request has been tagged as requiring documentation.

A documentation ticket will be opened at https://github.com/qgis/QGIS-Documentation when this PR is merged.

Please update the description (not the comments) with helpful description and screenshot to help the work from documentors.
Also, any commit having [needs-doc] or [Needs Documentation] in will see its message pushed to the issue, so please be as verbose as you can.

Thank you!

@qgis-bot
Copy link
Collaborator

@elpaso
A documentation ticket has been opened at qgis/QGIS-Documentation#9064
It is your responsibility to visit this ticket and add as much detail as possible for the documentation team to correctly document this change.
Thank you!

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! Changelog Items that are queued to appear in the visual changelog - remove after harvesting Feature Needs Documentation When merging a labeled PR, an issue will be created in the Doc repo.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Use FEATURE_COUNT parameter for WMS layer added via QGIS Browser
4 participants