Skip to content

Commit

Permalink
[processing] allow 2.5D geometries (fix #14929)
Browse files Browse the repository at this point in the history
(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 1271ec7
Show file tree
Hide file tree
Showing 5 changed files with 0 additions and 41 deletions.
9 changes: 0 additions & 9 deletions python/plugins/processing/algs/qgis/Clip.py
Expand Up @@ -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):

Expand All @@ -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(),
Expand Down
8 changes: 0 additions & 8 deletions python/plugins/processing/algs/qgis/Difference.py
Expand Up @@ -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):

Expand Down Expand Up @@ -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,
Expand Down
8 changes: 0 additions & 8 deletions python/plugins/processing/algs/qgis/Intersection.py
Expand Up @@ -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):

Expand All @@ -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())
Expand Down
8 changes: 0 additions & 8 deletions python/plugins/processing/algs/qgis/SymmetricalDifference.py
Expand Up @@ -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):

Expand Down Expand Up @@ -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())
Expand Down
8 changes: 0 additions & 8 deletions python/plugins/processing/algs/qgis/Union.py
Expand Up @@ -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):

Expand All @@ -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())
Expand Down

0 comments on commit 1271ec7

Please sign in to comment.