Skip to content

Commit

Permalink
Add in-place support
Browse files Browse the repository at this point in the history
  • Loading branch information
elpaso authored and nyalldawson committed Sep 14, 2018
1 parent b6f1634 commit 29fe9cc
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/analysis/processing/qgsalgorithmclip.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,12 @@ QgsClipAlgorithm *QgsClipAlgorithm::createInstance() const
return new QgsClipAlgorithm();
}

bool QgsClipAlgorithm::supportInPlaceEdit( const QgsVectorLayer *layer ) const
{
Q_UNUSED( layer );
return true;
}

QVariantMap QgsClipAlgorithm::processAlgorithm( const QVariantMap &parameters, QgsProcessingContext &context, QgsProcessingFeedback *feedback )
{
std::unique_ptr< QgsFeatureSource > featureSource( parameterAsSource( parameters, QStringLiteral( "INPUT" ), context ) );
Expand Down Expand Up @@ -141,7 +147,6 @@ QVariantMap QgsClipAlgorithm::processAlgorithm( const QVariantMap &parameters, Q
{
break;
}

QgsFeatureIterator inputIt = featureSource->getFeatures( QgsFeatureRequest().setFilterRect( clipGeom.boundingBox() ) );
QgsFeatureList inputFeatures;
QgsFeature f;
Expand Down
1 change: 1 addition & 0 deletions src/analysis/processing/qgsalgorithmclip.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ class QgsClipAlgorithm : public QgsProcessingAlgorithm
QString groupId() const override;
QString shortHelpString() const override;
QgsClipAlgorithm *createInstance() const override SIP_FACTORY;
bool supportInPlaceEdit( const QgsVectorLayer *layer ) const override;

QgsProcessingAlgorithm::Flags flags() const override;
protected:
Expand Down

0 comments on commit 29fe9cc

Please sign in to comment.