Skip to content
Permalink
Browse files

[processing] allow 2.5D geometries (fix #14929)

(cherry picked from commit 0553f7b)

Conflicts:
	python/plugins/processing/algs/qgis/Clip.py
	python/plugins/processing/algs/qgis/Difference.py
	python/plugins/processing/algs/qgis/Intersection.py
	python/plugins/processing/algs/qgis/SymmetricalDifference.py
	python/plugins/processing/algs/qgis/Union.py
  • Loading branch information
alexbruy committed Jun 13, 2016
1 parent f6aad8b commit 1271ec7e145215671301c161b640ea1c9df37113
@@ -34,10 +34,6 @@
from processing.core.outputs import OutputVector
from processing.tools import dataobjects, vector

GEOM_25D = [QGis.WKBPoint25D, QGis.WKBLineString25D, QGis.WKBPolygon25D,
QGis.WKBMultiPoint25D, QGis.WKBMultiLineString25D,
QGis.WKBMultiPolygon25D]


class Clip(GeoAlgorithm):

@@ -60,11 +56,6 @@ def processAlgorithm(self, progress):
layerB = dataobjects.getObjectFromUri(
self.getParameterValue(Clip.OVERLAY))

geomType = layerA.dataProvider().geometryType()
if geomType in GEOM_25D:
raise GeoAlgorithmExecutionException(
self.tr('Input layer has unsupported geometry type {}').format(geomType))

writer = self.getOutputFromName(self.OUTPUT).getVectorWriter(
layerA.pendingFields(),
layerA.dataProvider().geometryType(),
@@ -33,10 +33,6 @@
from processing.core.outputs import OutputVector
from processing.tools import dataobjects, vector

GEOM_25D = [QGis.WKBPoint25D, QGis.WKBLineString25D, QGis.WKBPolygon25D,
QGis.WKBMultiPoint25D, QGis.WKBMultiLineString25D,
QGis.WKBMultiPolygon25D]


class Difference(GeoAlgorithm):

@@ -65,10 +61,6 @@ def processAlgorithm(self, progress):
self.getParameterValue(Difference.OVERLAY))

geomType = layerA.dataProvider().geometryType()
if geomType in GEOM_25D:
raise GeoAlgorithmExecutionException(
self.tr('Input layer has unsupported geometry type {}').format(geomType))

writer = self.getOutputFromName(
Difference.OUTPUT).getVectorWriter(layerA.pendingFields(),
geomType,
@@ -43,10 +43,6 @@
for const in value:
wkbTypeGroups[const] = key

GEOM_25D = [QGis.WKBPoint25D, QGis.WKBLineString25D, QGis.WKBPolygon25D,
QGis.WKBMultiPoint25D, QGis.WKBMultiLineString25D,
QGis.WKBMultiPolygon25D]


class Intersection(GeoAlgorithm):

@@ -71,10 +67,6 @@ def processAlgorithm(self, progress):
vproviderA = vlayerA.dataProvider()

geomType = vproviderA.geometryType()
if geomType in GEOM_25D:
raise GeoAlgorithmExecutionException(
self.tr('Input layer has unsupported geometry type {}').format(geomType))

fields = vector.combineVectorFields(vlayerA, vlayerB)
writer = self.getOutputFromName(self.OUTPUT).getVectorWriter(fields,
geomType, vproviderA.crs())
@@ -33,10 +33,6 @@
from processing.core.outputs import OutputVector
from processing.tools import dataobjects, vector

GEOM_25D = [QGis.WKBPoint25D, QGis.WKBLineString25D, QGis.WKBPolygon25D,
QGis.WKBMultiPoint25D, QGis.WKBMultiLineString25D,
QGis.WKBMultiPolygon25D]


class SymmetricalDifference(GeoAlgorithm):

@@ -64,10 +60,6 @@ def processAlgorithm(self, progress):
providerB = layerB.dataProvider()

geomType = providerA.geometryType()
if geomType in GEOM_25D:
raise GeoAlgorithmExecutionException(
self.tr('Input layer has unsupported geometry type {}').format(geomType))

fields = vector.combineVectorFields(layerA, layerB)
writer = self.getOutputFromName(self.OUTPUT).getVectorWriter(
fields, geomType, providerA.crs())
@@ -42,10 +42,6 @@
for const in value:
wkbTypeGroups[const] = key

GEOM_25D = [QGis.WKBPoint25D, QGis.WKBLineString25D, QGis.WKBPolygon25D,
QGis.WKBMultiPoint25D, QGis.WKBMultiLineString25D,
QGis.WKBMultiPolygon25D]


class Union(GeoAlgorithm):

@@ -69,10 +65,6 @@ def processAlgorithm(self, progress):
vproviderA = vlayerA.dataProvider()

geomType = vproviderA.geometryType()
if geomType in GEOM_25D:
raise GeoAlgorithmExecutionException(
self.tr('Input layer has unsupported geometry type {}').format(geomType))

fields = vector.combineVectorFields(vlayerA, vlayerB)
writer = self.getOutputFromName(Union.OUTPUT).getVectorWriter(fields,
geomType, vproviderA.crs())

0 comments on commit 1271ec7

Please sign in to comment.
You can’t perform that action at this time.