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

[gdal_rasterize] Also accept doubles for -ts #11830

Conversation

elpaso
Copy link
Collaborator

@elpaso elpaso commented Feb 10, 2025

But warn if it has a decimal part.

Fixes #11829

Verified

This commit was signed with the committer’s verified signature.
kwasniew Mateusz Kwasniewski
But warn if it has a decimal part.

Fixes OSGeo#11829
@elpaso elpaso added bug funded through GSP Work funded through the GDAL Sponsorship Program labels Feb 10, 2025
@jratike80
Copy link
Collaborator

Out of curiosity, what will be the output size when the input is -ts 100.4 200.6?

@elpaso
Copy link
Collaborator Author

elpaso commented Feb 10, 2025

Out of curiosity, what will be the output size when the input is -ts 100.4 200.6?

The same as -ts 100 200 internally casted to int (but you'll get a warning the precision was lost).

@jratike80
Copy link
Collaborator

If the price of one beer is 8.2€ but you have only 8, would you ask the bartender
"Is it OK if the conversion to int looses precision for the price parameter"?

How about "Warning: The value of the -ts parameter gets truncated into [lower] integer"?

@coveralls
Copy link
Collaborator

Coverage Status

coverage: 70.055% (-0.008%) from 70.063%
when pulling 5be98e8 on elpaso:bugfix-gh_11829-gdal_rasterize-be-good-accept-double
into 6332083 on OSGeo:master.

Verified

This commit was signed with the committer’s verified signature.
kwasniew Mateusz Kwasniewski

Verified

This commit was signed with the committer’s verified signature.
kwasniew Mateusz Kwasniewski
@rouault rouault added the backport release/3.10 Backport to release/3.10 branch label Feb 11, 2025
@rouault rouault merged commit 37d0621 into OSGeo:master Feb 11, 2025
38 checks passed
@rouault rouault removed the backport release/3.10 Backport to release/3.10 branch label Feb 11, 2025
rouault pushed a commit that referenced this pull request Feb 11, 2025
But warn if it has a decimal part.

Fixes #11829
@rouault
Copy link
Member

rouault commented Feb 11, 2025

cherry-picked to 3.10 per bb9523f

@rouault rouault added this to the 3.10.2 milestone Feb 11, 2025
@rouault
Copy link
Member

rouault commented Feb 11, 2025

The backport to release/3.10 failed:

The process '/usr/bin/git' failed with exit code 1
stderr
error: could not apply 5be98e8ece... [gdal_rasterize] Also accept doubles for -ts
hint: After resolving the conflicts, mark them with
hint: "git add/rm <pathspec>", then run
hint: "git cherry-pick --continue".
hint: You can instead skip this commit with "git cherry-pick --skip".
hint: To abort and get back to the state before "git cherry-pick",
hint: run "git cherry-pick --abort".
hint: Disable this message with "git config set advice.mergeConflict false"

stdout
Auto-merging apps/gdal_rasterize_lib.cpp
CONFLICT (content): Merge conflict in apps/gdal_rasterize_lib.cpp
Auto-merging autotest/utilities/test_gdal_rasterize.py
CONFLICT (content): Merge conflict in autotest/utilities/test_gdal_rasterize.py

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.10 release/3.10
# Navigate to the new working tree
cd .worktrees/backport-release/3.10
# Create a new branch
git switch --create backport-11830-to-release/3.10
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick 5be98e8ece4e78381865056b714b889dab0a0d46,a8257444747bce33ace816c8a21e0da04b95f5dd,687fb22c024a35d474df9596e709070409a7111a
# Push it to GitHub
git push --set-upstream origin backport-11830-to-release/3.10
# Go back to the original working tree
cd ../..
# Delete the working tree
git worktree remove .worktrees/backport-release/3.10

Then, create a pull request where the base branch is release/3.10 and the compare/head branch is backport-11830-to-release/3.10.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug funded through GSP Work funded through the GDAL Sponsorship Program
Projects
None yet
Development

Successfully merging this pull request may close these issues.

gdal_rasterize -ts does not accept double anymore
4 participants