-
Notifications
You must be signed in to change notification settings - Fork 369
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Crash in concaveHullByLengthRatio #946
Comments
Confirmed this is an issue in JTS as well. The problem is that the input points are almost "flat". This produces very thin triangles, and the triangulation algorithm is unable to form a valid triangulation. Specifically, the triangulation is not edge-connected (it has a node which partitions the triangles into two sets). This causes an error when traversing the triangulation in the concave hull algorithm. This is caused by a known issue, which was partially fixed by #728. Clearly, an even larger frame size is required for this case. This probably only happens when the input points are very "flat". In this situation, it seems reasonable to simply return the convex hull. The problem is detectable and can be converted to an exception. A null-pointer check can be done here, and an exception thrown. Given this, potential workarounds are:
Even better is to detect that the Delaunay triangulation is incorrect, and return the convex hull. It might even be possible to fix the triangulation. This would be nice to have in the Delaunay Triangulation algorithm as well. |
A geosop command to reproduce:
|
The crash stack:
|
Another (I assume similar) example reported in shapely/shapely#1873:
The crash backtrace grom gdb (based on the original shapely reproducer):
|
Thanks. This is the same issue - an invalid Delaunay Triangulation is produced, which causes the Concave Hull algorithm to fail. |
Further research reveals that the fundamental problem is with the Delaunay Triangulation code. It is missing some logic to properly handle the "frame points" used in the algorithm. Hopefully this can be fixed soon. |
Interesting that so many of the reports are coming from use of the Concave Hull code. Good to know it's being used, anyway. |
Fixed by #953 |
Reported on postgis-users and confirmed directly in GEOS. Here's a test case
The text was updated successfully, but these errors were encountered: