-
-
Notifications
You must be signed in to change notification settings - Fork 223
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
Possibility to use Difference/Clip processing algorithme #5678
Conversation
qsavoye
commented
Sep 24, 2024
- Select vector geometry features
- Click on Process Selected Features
- New algo are availabe especially from Vector Overlay group, Choose Difference algo
- Select OVERLAY layer you want
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@qsavoye , hey there, thanks for the contribution! I've added a couple of comments that'd need addressing. Looking forward to merge this :)
Could you also install the pre-commit hook to insure formatting is done so it passes our CI tests? See documentation here: https://github.com/opengisch/QField/blob/master/doc/dev.md#contribute
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
context.setProject( QgsProject::instance() ); | ||
for ( auto it = map.begin(); it != map.end(); ++it ) | ||
{ | ||
if ( it.value()->type() == Qgis::LayerType::Vector && QgsProcessingUtils::variantToSource( it.value()->name(), context, mParameters.at( index.row() )->defaultValue() ) ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@qsavoye , we didn't need the vartiantToSource here, but what we definitively needed was to do a check against the parameter's dataTypes() to filter out of vector layers that are not part of list of geometry types passed by the algorithms.
I've done that here: https://github.com/opengisch/QField/pull/5690/files#diff-15f7c96b0c450067ace3ed62a83f37fea47213c6cdefbf28bba20747ff6634d2R302
@@ -151,8 +151,11 @@ void ProcessingAlgorithmParametersModelBase::rebuild() | |||
mHasAdvancedParameters = true; | |||
} | |||
|
|||
mParameters << definition; | |||
mValues << definition->defaultValue(); | |||
if ( definition->name() != "INPUT" ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just to be extra safe, I've added a definition->type() == QStringLiteral( "source" ) condition here:
Superseded by #5690 |