Skip to content

Commit

Permalink
Boundary alg requires geometry for in-place edits
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Sep 21, 2018
1 parent df657d4 commit a764b4b
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/analysis/processing/qgsalgorithmboundary.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
***************************************************************************/

#include "qgsalgorithmboundary.h"
#include "qgsvectorlayer.h"

///@cond PRIVATE

Expand Down Expand Up @@ -62,6 +63,15 @@ QList<int> QgsBoundaryAlgorithm::inputLayerTypes() const
return QList<int>() << QgsProcessing::TypeVectorLine << QgsProcessing::TypeVectorPolygon;
}

bool QgsBoundaryAlgorithm::supportInPlaceEdit( const QgsMapLayer *l ) const
{
const QgsVectorLayer *layer = qobject_cast< const QgsVectorLayer * >( l );
if ( !layer )
return false;

return layer->isSpatial();
}

QgsBoundaryAlgorithm *QgsBoundaryAlgorithm::createInstance() const
{
return new QgsBoundaryAlgorithm();
Expand Down
1 change: 1 addition & 0 deletions src/analysis/processing/qgsalgorithmboundary.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ class QgsBoundaryAlgorithm : public QgsProcessingFeatureBasedAlgorithm
QString groupId() const override;
QString shortHelpString() const override;
QList<int> inputLayerTypes() const override;
bool supportInPlaceEdit( const QgsMapLayer *layer ) const override;
QgsBoundaryAlgorithm *createInstance() const override SIP_FACTORY;

protected:
Expand Down

0 comments on commit a764b4b

Please sign in to comment.