mirror of
https://github.com/qgis/QGIS.git
synced 2025-04-17 00:04:02 -04:00
[processing] Add NULL geometry support to centroid algorithm
This commit is contained in:
parent
ce0d6102c3
commit
cd10c6c88e
@ -68,10 +68,10 @@ class Centroids(GeoAlgorithm):
|
|||||||
attrs = inFeat.attributes()
|
attrs = inFeat.attributes()
|
||||||
|
|
||||||
if not inGeom:
|
if not inGeom:
|
||||||
outGeom = QgsGeometry()
|
outGeom = QgsGeometry(None)
|
||||||
else:
|
else:
|
||||||
outGeom = QgsGeometry(inGeom.centroid())
|
outGeom = QgsGeometry(inGeom.centroid())
|
||||||
if outGeom is None:
|
if not outGeom:
|
||||||
raise GeoAlgorithmExecutionException(
|
raise GeoAlgorithmExecutionException(
|
||||||
self.tr('Error calculating centroid'))
|
self.tr('Error calculating centroid'))
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user