mirror of
https://github.com/qgis/QGIS.git
synced 2025-04-15 00:04:00 -04:00
[processing] allow 2.5D geometries (fix #14929)
This commit is contained in:
parent
e926e2d0aa
commit
0553f7b33b
@ -40,10 +40,6 @@ from processing.tools import dataobjects, vector
|
||||
|
||||
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 @@ class Clip(GeoAlgorithm):
|
||||
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 @@ from processing.tools import dataobjects, vector
|
||||
|
||||
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 @@ class Difference(GeoAlgorithm):
|
||||
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 key, value in wkbTypeGroups.items():
|
||||
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 @@ class Intersection(GeoAlgorithm):
|
||||
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 @@ from processing.tools import dataobjects, vector
|
||||
|
||||
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 @@ class SymmetricalDifference(GeoAlgorithm):
|
||||
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 key, value in wkbTypeGroups.items():
|
||||
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 @@ class Union(GeoAlgorithm):
|
||||
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())
|
||||
|
Loading…
x
Reference in New Issue
Block a user