Skip to content

Commit

Permalink
Backport [processing] ensure that outputs of vector overlay operation…
Browse files Browse the repository at this point in the history
…s are multiparts (#3622)
  • Loading branch information
m-kuhn committed Oct 20, 2016
1 parent 24f3cc5 commit deb3dc7
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 7 deletions.
7 changes: 3 additions & 4 deletions python/plugins/processing/algs/qgis/Clip.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,9 @@ def processAlgorithm(self, progress):
layerB = dataobjects.getObjectFromUri(
self.getParameterValue(Clip.OVERLAY))

writer = self.getOutputFromName(self.OUTPUT).getVectorWriter(
layerA.pendingFields(),
layerA.dataProvider().geometryType(),
layerA.dataProvider().crs())
geomType = QGis.multiType(layerA.wkbType())
fields = layerA.pendingFields()
writer = self.getOutputFromName(self.OUTPUT).getVectorWriter(fields, geomType, layerA.crs())

inFeatA = QgsFeature()
inFeatB = QgsFeature()
Expand Down
2 changes: 1 addition & 1 deletion python/plugins/processing/algs/qgis/Difference.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ def processAlgorithm(self, progress):
self.getParameterValue(Difference.OVERLAY))
ignoreInvalid = self.getParameterValue(Difference.IGNORE_INVALID)

geomType = layerA.wkbType()
geomType = QGis.multiType(layerA.wkbType())
writer = self.getOutputFromName(
Difference.OUTPUT).getVectorWriter(layerA.pendingFields(),
geomType,
Expand Down
2 changes: 1 addition & 1 deletion python/plugins/processing/algs/qgis/Intersection.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ def processAlgorithm(self, progress):
vlayerB = dataobjects.getObjectFromUri(
self.getParameterValue(self.INPUT2))

geomType = vlayerA.wkbType()
geomType = QGis.multiType(vlayerA.wkbType())
fields = vector.combineVectorFields(vlayerA, vlayerB)
writer = self.getOutputFromName(self.OUTPUT).getVectorWriter(fields,
geomType, vlayerA.crs())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ def processAlgorithm(self, progress):
layerB = dataobjects.getObjectFromUri(
self.getParameterValue(self.OVERLAY))

geomType = layerA.wkbType()
geomType = QGis.multiType(layerA.wkbType())
fields = vector.combineVectorFields(layerA, layerB)
writer = self.getOutputFromName(self.OUTPUT).getVectorWriter(
fields, geomType, layerA.crs())
Expand Down

0 comments on commit deb3dc7

Please sign in to comment.