Skip to content

Commit

Permalink
[processing] allow 2.5D geometries (fix #14929)
Browse files Browse the repository at this point in the history
  • Loading branch information
alexbruy committed Jun 13, 2016
1 parent e926e2d commit 0553f7b
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 @@ -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):

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

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

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

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

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

0 comments on commit 0553f7b

Please sign in to comment.