spacesyntax / CatchmentAnalyser

Calculate catchments from multiple origins using multiple costs.
GNU General Public License v3.0
0 stars 1 forks source link

When recursion depth reached the plugin crashes and closes without leaving an error #8

Closed gregmaya closed 7 years ago

gregmaya commented 7 years ago

In this case the memory layer came from Urban Data Input Plugin ("memory: Entrances").

log message: Catchment Analyser raised an exception: Traceback (most recent call last): File "C:/Users/g.maya/.qgis2/python/plugins\CatchmentAnalyser-master\catchment_tools.py", line 725, in analysis self.settings['polygon tolerance'] File "C:/Users/g.maya/.qgis2/python/plugins\CatchmentAnalyser-master\catchment_tools.py", line 654, in polygon_writer hull = self.concave_hull.concave_hull(points, polygon_tolerance) File "C:/Users/g.maya/.qgis2/python/plugins\CatchmentAnalyser-master\catchment_tools.py", line 435, in concave_hull return self.concave_hull(points_list, kk + 1) File "C:/Users/g.maya/.qgis2/python/plugins\CatchmentAnalyser-master\catchment_tools.py", line 387, in concave_hull c_points = self.sort_by_angle(k_nearest_points, current_point, previous_angle) File "C:/Users/g.maya/.qgis2/python/plugins\CatchmentAnalyser-master\catchment_tools.py", line 321, in sort_by_angle vertex_list = sorted(list_of_points, key=getkey, reverse=True) File "C:/Users/g.maya/.qgis2/python/plugins\CatchmentAnalyser-master\catchment_tools.py", line 319, in getkey return self.angle_difference(last_angle, self.angle(last_point, item)) File "C:/Users/g.maya/.qgis2/python/plugins\CatchmentAnalyser-master\catchment_tools.py", line 138, in angle_difference if (angle1 > 0 and angle2 >= 0) and angle1 > angle2: RuntimeError: maximum recursion depth exceeded in cmp

jorgegil commented 7 years ago

This is related to issue #4 . Origins in memory layer works fine for a small number of origins.

jorgegil commented 7 years ago

This must be addressed by reviewing the convex hull algorithm, as per comments in #4. For now I've added some error catches to carry on when the limit is reached.