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

[processing] don't try to dissolve buffer results if there are no features (fix #46396) #47348

Merged
merged 2 commits into from
Feb 15, 2022
Merged

[processing] don't try to dissolve buffer results if there are no features (fix #46396) #47348

merged 2 commits into from
Feb 15, 2022

Conversation

alexbruy
Copy link
Contributor

Description

Buffering an empty layer with native "Buffer" algorithm produces empty output layer, while the same operation with enabled "Dissolve result" option ends with error message

Feature could not be written to Buffered_a03cb901_262a_4ed5_b22c_23aeb10000b1: Could not add feature with geometry type GeometryCollection to layer of type MultiPolygon
Could not write feature into OUTPUT
Execution failed after 0.01 seconds

This creates problems when algorithm is used as part of a model. For consistence it is better to produce empty layer in both cases.

Fixes #46396.

@alexbruy alexbruy added Processing Relating to QGIS Processing framework or individual Processing algorithms backport queued_ltr_backports Queued Backports labels Feb 14, 2022
@github-actions github-actions bot added this to the 3.24.0 milestone Feb 14, 2022
@nyalldawson
Copy link
Collaborator

Could we get a test for this?

@alexbruy
Copy link
Contributor Author

Test added

@nyalldawson nyalldawson merged commit bf406a5 into qgis:master Feb 15, 2022
@qgis-bot
Copy link
Collaborator

The backport to queued_ltr_backports failed:

The process '/usr/bin/git' failed with exit code 1
stderr
error: could not apply 913a4fce0e... add test for buffering empty layer with dissolve
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".

stdout
[backport-47348-to-queued_ltr_backports 7d76f784e4] [processing] don't try to dissolve buffer results if there are no features (fix #46396)
 Author: Alexander Bruy <alexander.bruy@gmail.com>
 Date: Mon Feb 14 18:03:49 2022 +0200
 1 file changed, 1 insertion(+), 1 deletion(-)
Auto-merging tests/src/analysis/testqgsprocessingalgs.cpp
CONFLICT (content): Merge conflict in tests/src/analysis/testqgsprocessingalgs.cpp

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-47348-to-queued_ltr_backports
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick d4c148e03d3f5bb93dc0d5a7f883ffa83b5c206b,913a4fce0e9ca2c08557b1e225e25104fa10550f
# Push it to GitHub
git push --set-upstream origin backport-47348-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 base branch is queued_ltr_backports and the compare/head branch is backport-47348-to-queued_ltr_backports.

@agiudiceandrea
Copy link
Contributor

agiudiceandrea commented Jun 5, 2023

@alexbruy please see a similar issue reported at #53360 (new issue at #53392) about the Dissolve processing algorithm.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport queued_ltr_backports Queued Backports failed backport The automated backport attempt failed, needs a manual backport Processing Relating to QGIS Processing framework or individual Processing algorithms
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Error when making buffer from empty layer with 'Dissolve result' option checked
4 participants