-
-
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
ensures that "gdal:rasterize" uses integer numbers as input to -ts parameter #60533
Conversation
🪟 Windows buildsDownload Windows builds of this PR for testing. 🪟 Windows Qt6 buildsDownload Windows Qt6 builds of this PR for testing. |
The previous behaviour was to use floating point values for the -ts parameter, but when the values were used by gdal_rasterize they were truncated (not rounded) internally by GDAL. |
@agiudiceandrea |
@jakimowb, thanks! May you add an explicit test for |
Can you set Qgis::ProcessingNumberParameterType::Integer in the constructor for QgsProcessingParameterNumber ? |
@elpaso, AFAIK it is not possible, since the HEIGHT and WIDTH algorithm's parameters are used for both the -tr option (which needs double values) and the -ts option (which needs integer values). |
@elpaso as @agiudiceandrea mentioned, this is not possible. It would be an interesting new feature if QgsProcessingParameters could be switched on and off or change its configuration depending on other parameter values. |
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-release-3_40 release-3_40
# Navigate to the new working tree
cd .worktrees/backport-release-3_40
# Create a new branch
git switch --create backport-60533-to-release-3_40
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick fd61e5cca642c10d3f0e1966a237e912849e485a,81c553d0c9cde410290115112d163a94d9a99513,d9a1f42bd89332bf71ada66d77c859f626009909,ce0c311ba969096f7326cb5df484fe01eb58d819,8d4b6a03dfffa742f2bf1e5b6ca1a0f20f155bbf,244303f1e3064593515f379c901e7aecad150c6d,8a575a422294f054e476dcbdf055c8e1edda515a
# Push it to GitHub
git push --set-upstream origin backport-60533-to-release-3_40
# Go back to the original working tree
cd ../..
# Delete the working tree
git worktree remove .worktrees/backport-release-3_40 Then, create a pull request where the |
Manual backport PR: #60564. |
Description
fixes #60524
python/plugins/processing/algs/gdal/rasterize.py
rasterize(GdalAlgorithm).getConsoleCommands(...) now ensures that values for the GDAL -ts parameter are written as int values.