Bug report #17026
Error for Mean coordinate(s) when geometry is NULL
Status: | Closed | ||
---|---|---|---|
Priority: | Normal | ||
Assignee: | Victor Olaya | ||
Category: | Processing/QGIS | ||
Affected QGIS version: | 2.18.11 | Regression?: | No |
Operating System: | Easy fix?: | No | |
Pull Request or Patch supplied: | No | Resolution: | |
Crashes QGIS or corrupts data: | No | Copied to github as #: | 24925 |
Description
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.
Associated revisions
[processing] correctly handle null gems in meancoords alg
Fixes #17026
History
#1 Updated by Giovanni Manghi over 7 years ago
- Affected QGIS version changed from 2.14.0 to 2.18.11
#2 Updated by Victor Olaya over 7 years ago
- % Done changed from 0 to 100
- Status changed from Open to Closed
Applied in changeset qgis|667ba4255e87e8e05051e7fa8b4851633b3da4b7.