Closed julcan7 closed 1 month ago
A screenshot of the issue:
The Voronoi package returns a mix of bounded and unbounded regions. In the identified issue, certain combinations of geometries resulted in no trunk line being created because all of the returned regions were unbounded. This issue was resolved by adding an extra step in the simplify_trunk_lines function, which generates additional boundary points around the bounding box of the geometries, using a padding equal to 10% of the largest dimension of the box
In the picture below, the figure on the left illustrates how all regions for the given geometry are unbounded. By adding padding points around the original geometry and appending them to the points generated around the polygon, the regions are forced to converge, resulting in bounded regions, as shown in the figure on the right.
An error occurs when attempting to run the simplify_trunk_lines function in the dist_funcs.py script. The function raises a GeometryTypeError, indicating that splitting a GeometryCollection is not supported.
This errors appears when the following conditions is not met: “if not -1 in region and len(region) > 0:” (Line 147 in the script dist_funcs.py), due that all of the regions from the voronoi regions contains a -1 in each one of the lists, causing that the voronoi_polygons geometry is empty, thus, causing that there are not trunk lines.