-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
show warning if float raster is used as input in zonal histogram algorithm (fix #30822) #60212
show warning if float raster is used as input in zonal histogram algorithm (fix #30822) #60212
Conversation
@nirvn what do you think about this, maybe it would be enough just to extend algorithm help without introducing rounding of the input? |
🪟 Windows buildsDownload Windows builds of this PR for testing. 🪟 Windows Qt6 buildsDownload Windows Qt6 builds of this PR for testing. |
@alexbruy , I feel when it comes to float, an histogram doesn't make tons of sense even with rounding. Feels more like they should go through a reclassify by table alg. first to define their bins. Or, as you suggested, rounding (I guess if you'd have a temperature raster, some rounding to 0 decimal could give you some interesting 1-degree breakdown of temperature :) ). In any case, I am wondering if the proper fix here would simply to through users a warning about float not being friendly to histogram and encourage them to use round raster or reclassify by table algs instead of adding a decimal rounding parameter in this alg. I've got no strong feelings about it though, if you do like the parameter approach, I'll +1. |
histoghram algorithm (fix qgis#30822)
eef20ce
to
9342506
Compare
@nirvn I'm also more in favor of warning, as this is more in line with Processing approach. One can create a model/script if necessary. PR updated to show a warning. |
The backport to
stderr
stdout
To backport manually, run these commands in your terminal: # Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add .worktrees/backport-queued_ltr_backports queued_ltr_backports
# Navigate to the new working tree
cd .worktrees/backport-queued_ltr_backports
# Create a new branch
git switch --create backport-60212-to-queued_ltr_backports
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick 93425063f3322ea59be965848c7bd99728b722c6,5717abd1c8f6c2d83398f75461a0ca58240b5b5f,69f7317d9ef95cc84f01026f27bd0333b0c90caf
# Push it to GitHub
git push --set-upstream origin backport-60212-to-queued_ltr_backports
# Go back to the original working tree
cd ../..
# Delete the working tree
git worktree remove .worktrees/backport-queued_ltr_backports Then, create a pull request where the |
Description
Zonal Histogram algorithm from Processing is not suitable for running against floating point raster values with lots of decimal places and produces output with lots of attributes.
If user uses a floating-point raster as an input the algorithm will now show a warning and suggest to run Reclassify by table or Round raster tools first.
Fixes #30822.