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 in-place do not check validity when fixing geometries #8730

Merged
merged 2 commits into from
Dec 22, 2018

Conversation

elpaso
Copy link
Contributor

@elpaso elpaso commented Dec 21, 2018

Fixes #20812

@luipir luipir changed the title Processing in-place do not check validity when fixing geometries Processing in-place do not check validity when fixing geometries, Fixes #20812 Dec 21, 2018
@luipir luipir changed the title Processing in-place do not check validity when fixing geometries, Fixes #20812 Processing in-place do not check validity when fixing geometries. Fixes #20812 Dec 21, 2018
@luipir luipir changed the title Processing in-place do not check validity when fixing geometries. Fixes #20812 Processing in-place do not check validity when fixing geometries Dec 21, 2018
@m-kuhn
Copy link
Member

m-kuhn commented Dec 21, 2018

Could alg.sourceFlags() be used instead of the part labeled with "ugly hack"?

@elpaso
Copy link
Contributor Author

elpaso commented Dec 21, 2018

@m-kuhn yes, that's probably much less "ugly" ;) I'l l see if it can be used in this context.

@elpaso
Copy link
Contributor Author

elpaso commented Dec 21, 2018

@m-kuhn it worked! Thanks.

@m-kuhn
Copy link
Member

m-kuhn commented Dec 21, 2018

Nice.
I thought only feature based algorithms can be used in place, is that not true?

@elpaso
Copy link
Contributor Author

elpaso commented Dec 21, 2018

No: all algorithms can be used for in-place, there are separate code paths for the two types.

@m-kuhn
Copy link
Member

m-kuhn commented Dec 21, 2018

How does it decide which input to take in such cases? What I'm wondering if there's a more portable solution that works for any algorithm.

@elpaso
Copy link
Contributor Author

elpaso commented Dec 21, 2018

I'm not sure about what you mean but I don't see a way to set the context geom flags for non-feature-based (unless the sourceFlags() is moved to the base class), have a look to: https://github.com/qgis/QGIS/blob/master/python/plugins/processing/gui/AlgorithmExecutor.py#L149 for feature based and a few lines below for the other case:

https://github.com/qgis/QGIS/blob/master/python/plugins/processing/gui/AlgorithmExecutor.py#L194

@m-kuhn
Copy link
Member

m-kuhn commented Dec 21, 2018

Oh, I didn't realize that the code paths are so different. Looks like that's taken care of with https://github.com/qgis/QGIS/blob/master/python/plugins/processing/gui/AlgorithmExecutor.py#L198 for the other case (in which it chooses the parameters called INPUT and OUTPUT if I read this correctly).

I think it would be nice to also have this flag on QgsProcessingParameterFeatureSource, but that's a different story.

Looks good to me now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants