Error for Mean coordinate(s) when geometry is NULL #24925
Labels
Bug
Either a bug report, or a bug fix. Let's hope for the latter!
Processing
Relating to QGIS Processing framework or individual Processing algorithms
Author Name: Loïc BARTOLETTI (@lbartoletti)
Original Redmine Issue: 17026
Affected QGIS version: 2.18.11
Redmine category:processing/qgis
Assignee: Victor Olaya
Hi,
A little error when you try to use MeanCoords algorithm with a layer which contain NULL geometry.
The solution is to clean this layer or add maybe add a test on geometry before run the algorithm.
@2017-08-17T11:22:48 2 Uncaught error while executing algorithm
Traceback (most recent call last):
File "C:/Users/da14/.qgis2/python/plugins\processing\core\GeoAlgorithm.py", line 230, in execute
self.processAlgorithm(progress)
File "C:/Users/da14/.qgis2/python/plugins\processing\algs\qgis\MeanCoords.py", line 116, in processAlgorithm
cx = values[0] / values[2]
ZeroDivisionError: integer division or modulo by zero@
You can reproduce it with a testdata (shp_with_null_geometry_extract.shp) and run the algorithm with Unique ID field set to "HubName".
The Null geometries have HubName set to Null.
Tested with QGis 2.14.17, 2.18.11 and master.
Thank you.
The text was updated successfully, but these errors were encountered: