Skip to content
Permalink
Browse files

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

  • Loading branch information
alexbruy committed Jun 13, 2016
1 parent e926e2d commit 0553f7b33b4a3294f9a1cfb24e8c238f9211503d
@@ -40,10 +40,6 @@

pluginPath = os.path.split(os.path.split(os.path.dirname(__file__))[0])[0]

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


class Clip(GeoAlgorithm):

@@ -69,11 +65,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 does not support 2.5D type geometry ({}).').format(QgsWKBTypes.displayString(geomType)))

writer = self.getOutputFromName(self.OUTPUT).getVectorWriter(
layerA.pendingFields(),
layerA.dataProvider().geometryType(),
@@ -39,10 +39,6 @@

pluginPath = os.path.split(os.path.split(os.path.dirname(__file__))[0])[0]

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


class Difference(GeoAlgorithm):

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

geomType = layerA.dataProvider().geometryType()
if geomType in GEOM_25D:
raise GeoAlgorithmExecutionException(
self.tr('Input layer does not support 2.5D type geometry ({}).').format(QgsWKBTypes.displayString(geomType)))

writer = self.getOutputFromName(
Difference.OUTPUT).getVectorWriter(layerA.pendingFields(),
geomType,
@@ -49,10 +49,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):

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

geomType = vproviderA.geometryType()
if geomType in GEOM_25D:
raise GeoAlgorithmExecutionException(
self.tr('Input layer does not support 2.5D type geometry ({}).').format(QgsWKBTypes.displayString(geomType)))

fields = vector.combineVectorFields(vlayerA, vlayerB)
writer = self.getOutputFromName(self.OUTPUT).getVectorWriter(fields,
geomType, vproviderA.crs())
@@ -39,10 +39,6 @@

pluginPath = os.path.split(os.path.split(os.path.dirname(__file__))[0])[0]

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


class SymmetricalDifference(GeoAlgorithm):

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

geomType = providerA.geometryType()
if geomType in GEOM_25D:
raise GeoAlgorithmExecutionException(
self.tr('Input layer does not support 2.5D type geometry ({}).').format(QgsWKBTypes.displayString(geomType)))

fields = vector.combineVectorFields(layerA, layerB)
writer = self.getOutputFromName(self.OUTPUT).getVectorWriter(
fields, geomType, providerA.crs())
@@ -49,10 +49,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):

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

geomType = vproviderA.geometryType()
if geomType in GEOM_25D:
raise GeoAlgorithmExecutionException(
self.tr('Input layer does not support 2.5D type geometry ({}).').format(QgsWKBTypes.displayString(geomType)))

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

0 comments on commit 0553f7b

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