mirror of
https://github.com/qgis/QGIS.git
synced 2025-04-15 00:04:00 -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()
|
||||
|
||||
if not inGeom:
|
||||
outGeom = QgsGeometry()
|
||||
outGeom = QgsGeometry(None)
|
||||
else:
|
||||
outGeom = QgsGeometry(inGeom.centroid())
|
||||
if outGeom is None:
|
||||
if not outGeom:
|
||||
raise GeoAlgorithmExecutionException(
|
||||
self.tr('Error calculating centroid'))
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user