Skip to content

Commit

Permalink
Fix some exceptions when running in-place edit on geometry-less layer
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Sep 21, 2018
1 parent 4b24552 commit df657d4
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
5 changes: 4 additions & 1 deletion python/plugins/processing/algs/qgis/LinesToPolygons.py
Expand Up @@ -94,8 +94,11 @@ def processFeature(self, feature, context, feedback):
feedback.reportError(self.tr("One or more line ignored due to geometry not having a minimum of three vertices."))
return [feature]

def supportInPlaceEdit(self, layer):
return False

def convertWkbToPolygons(self, wkb):
multi_wkb = None
multi_wkb = QgsWkbTypes.NoGeometry
if QgsWkbTypes.singleType(QgsWkbTypes.flatType(wkb)) == QgsWkbTypes.LineString:
multi_wkb = QgsWkbTypes.MultiPolygon
elif QgsWkbTypes.singleType(QgsWkbTypes.flatType(wkb)) == QgsWkbTypes.CompoundCurve:
Expand Down
5 changes: 4 additions & 1 deletion python/plugins/processing/algs/qgis/PolygonsToLines.py
Expand Up @@ -85,8 +85,11 @@ def processFeature(self, feature, context, feedback):
feature.setGeometry(QgsGeometry(self.convertToLines(feature.geometry())))
return [feature]

def supportInPlaceEdit(self, layer):
return False

def convertWkbToLines(self, wkb):
multi_wkb = None
multi_wkb = QgsWkbTypes.NoGeometry
if QgsWkbTypes.singleType(QgsWkbTypes.flatType(wkb)) == QgsWkbTypes.Polygon:
multi_wkb = QgsWkbTypes.MultiLineString
elif QgsWkbTypes.singleType(QgsWkbTypes.flatType(wkb)) == QgsWkbTypes.CurvePolygon:
Expand Down

0 comments on commit df657d4

Please sign in to comment.