-
-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Raster labeling #59753
Raster labeling #59753
Conversation
This pull request has been tagged for the changelog.
You can edit the description. Format available for credits
Thank you! |
@nyalldawson 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. Thank you! |
🪟 Windows buildsDownload Windows builds of this PR for testing. 🪟 Windows Qt6 buildsDownload Windows Qt6 builds of this PR for testing. |
Very nice feature. A couple of silly questions maybe:
|
No -- right now the band selection is fixed, and you get the pixel values only. (There's kind-of expression support via the "custom expression" option in the number format panel, but that's limited). I think it'd be nice for a follow up to add an expression based labels mode, so eg you can get all band values as a list and choose how to display these (but that's not in my current scope).
It's not planned, but I do have a follow up coming which will allow the labels to show downsampled values (eg labeling only every second pixel) |
Great work and thanks for the explanation. |
d03bcd2
to
a489384
Compare
ee88455
to
6d556ba
Compare
Tests failed for Qt 6One or more tests failed using the build from commit 6d556ba resamplingresamplingTest failed at test_render_resampled at tests/src/python/test_qgsrasterlabeling.py:324 Rendered image did not match tests/testdata/control_images/raster_labeling/expected_resampling/expected_resampling.png (found 9080 pixels different) The full test report (included comparison of rendered vs expected images) can be found here. Further documentation on the QGIS test infrastructure can be found in the Developer's Guide. |
@nyalldawson , I'll do it. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A couple of comments.
We'll need the labeling panel to also be featured in the raster properties dialog before we ship the functionality.
But beyond that, big thanks! It's something I was looking for multiple times.
Allows raster pixels to be labeled with the value taken from a raster band. Labels are registered with the labeling engine, so participate in label conflict resolution and overlap avoidance Options include - Selection of band to take values from - Using QgsNumericFormat to customise the number format for the labels - Uses text renderer, so supports buffers, shadows, etc - Label priority - Scale dependant visibility - Optional pixel size dependent visibilty, ie show only when pixels are > 4mm in size - Z index control, overlap avoidance mode Fixes qgis#14408
Keeps XML minimized when not required
c3262ef
to
236dbd6
Compare
Ok, done! |
@nyalldawson |
Thanks for this, I can think of a couple of times that would have been useful! |
Allows raster pixels to be labeled with the value taken from a raster band.
Labels are registered with the labeling engine, so participate in label conflict resolution and overlap avoidance
Options include
Fixes #14408
Funded by Canton de Neuchâtel
Peek.2024-12-05.15-41.mp4