Skip to content

Commit a764b4b

Browse files
committedSep 21, 2018
Boundary alg requires geometry for in-place edits
1 parent df657d4 commit a764b4b

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed
 

‎src/analysis/processing/qgsalgorithmboundary.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
***************************************************************************/
1717

1818
#include "qgsalgorithmboundary.h"
19+
#include "qgsvectorlayer.h"
1920

2021
///@cond PRIVATE
2122

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

66+
bool QgsBoundaryAlgorithm::supportInPlaceEdit( const QgsMapLayer *l ) const
67+
{
68+
const QgsVectorLayer *layer = qobject_cast< const QgsVectorLayer * >( l );
69+
if ( !layer )
70+
return false;
71+
72+
return layer->isSpatial();
73+
}
74+
6575
QgsBoundaryAlgorithm *QgsBoundaryAlgorithm::createInstance() const
6676
{
6777
return new QgsBoundaryAlgorithm();

‎src/analysis/processing/qgsalgorithmboundary.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ class QgsBoundaryAlgorithm : public QgsProcessingFeatureBasedAlgorithm
4141
QString groupId() const override;
4242
QString shortHelpString() const override;
4343
QList<int> inputLayerTypes() const override;
44+
bool supportInPlaceEdit( const QgsMapLayer *layer ) const override;
4445
QgsBoundaryAlgorithm *createInstance() const override SIP_FACTORY;
4546

4647
protected:

0 commit comments

Comments
 (0)
Please sign in to comment.