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

Add fixed elevation range per dataset group mode for mesh layers #56977

Merged
merged 8 commits into from
May 14, 2024

Conversation

nyalldawson
Copy link
Collaborator

This mimics the "fixed range per band" mode we have for raster layers, but allows a per-dataset group elevation range to be set for mesh layers

@nyalldawson nyalldawson added the Requires Tests! Waiting on the submitter to add unit tests before eligible for merging label Mar 27, 2024
@github-actions github-actions bot added this to the 3.38.0 milestone Mar 27, 2024
@nyalldawson
Copy link
Collaborator Author

@wonder-sk I'd love your eyes on this one to confirm that this is using the mesh layer APIs correctly

Copy link

github-actions bot commented Mar 27, 2024

🪟 Windows builds ready!

Windows builds of this PR are available for testing here. Debug symbols for this build are available here.

(Built from commit 4afec6a)

@wonder-sk
Copy link
Member

@nyalldawson it is a bit more complicated with mesh layers compared to raster layers: it is common that within a single layer, there are multiple quantities - take for example ecmwf-test-data.zip (could be used for auto-tests if needed) - it contains three quantities (Humidity, Temperature, Vorticity), each at different times and at different elevation levels. Right now, each elevation level is recognized as a separate dataset group in the styling panel:

image (20)

But with the "fixed elevation range per group" mode, all these dataset groups should be collapsed into just those three quantities, so that users could switch which quantity is active for rendering.

A major problem with the current implementation is that user can both move elevation controller's slider and change active dataset groups in the styling panel, but it is unclear what the map canvas is actually showing.

In order to fix that, I think in the configuration dialog, in the table of groups with lower/upper limit, we will need one more column - the quantity (kind of "super-group" that combines multiple dataset groups into one). It would be great if the quantity could be populated from an expression as well.

image

With these quantity super-groups, the styling panel could then show just the super-groups instead of "normal" groups (that represent just one particular elevation level). So right now, QgsMeshRendererSettings has mActiveScalarDatasetGroup and mActiveVectorDatasetGroup - which in this mode do not make sense anymore - probably these variables can be replaced either by active group name, or by a list of active dataset groups - and QgsMeshLayerRenderer would pick which dataset group to use based on the elevation controller.

And hopefully at some point later, MDAL will report extra metadata for each dataset group: 1. what elevation does it relate to, 2. what quantity does it belong to. With those bits, QGIS should be able to auto-populate the elevation-related configuration.

@github-actions github-actions bot added the stale Uh oh! Seems this work is abandoned, and the PR is about to close. label Apr 11, 2024
@qgis qgis deleted a comment from github-actions bot Apr 11, 2024
@wonder-sk wonder-sk removed the stale Uh oh! Seems this work is abandoned, and the PR is about to close. label Apr 11, 2024
@nyalldawson
Copy link
Collaborator Author

@wonder-sk thanks for the insights!

That sounds like a rather large, low level refactoring of how mesh datasets are handled in QGIS. I'd like to avoid that here, and just get the elevation part working.

What do you think about ffa6b2d as a potential workaround for now?

Copy link
Member

@wonder-sk wonder-sk left a comment

Choose a reason for hiding this comment

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

Okay, let's do it like this as a workaround...

src/core/mesh/qgsmeshdataset.cpp Outdated Show resolved Hide resolved
src/core/mesh/qgsmeshdataset.h Outdated Show resolved Hide resolved
@nyalldawson nyalldawson force-pushed the mesh_elevation branch 2 times, most recently from 5b2001d to 7c952af Compare May 13, 2024 02:45
@nyalldawson nyalldawson 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 and removed Requires Tests! Waiting on the submitter to add unit tests before eligible for merging labels May 13, 2024
@qgis-bot
Copy link
Collaborator

@nyalldawson
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

@nyalldawson

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!

@nyalldawson nyalldawson merged commit dd01d11 into qgis:master May 14, 2024
39 checks passed
@nyalldawson nyalldawson deleted the mesh_elevation branch May 14, 2024 02:00
@qgis-bot
Copy link
Collaborator

@nyalldawson
A documentation ticket has been opened at qgis/QGIS-Documentation#9100
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!

@zacharlie zacharlie added ChangelogHarvested This PR description has been harvested in the Changelog already. and removed Changelog Items that are queued to appear in the visual changelog - remove after harvesting labels Jun 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ChangelogHarvested This PR description has been harvested in the Changelog already. 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.

4 participants