Created
April 12, 2014 23:20
-
-
Save dwyerk/10561690 to your computer and use it in GitHub Desktop.
concave hulls using shapely and scipy
FYI for anyone running this notebook today (unless Descartes receives an update), you need to patch Descartes as described in this stackoverflow answer or the plot_polygon won't work https://stackoverflow.com/questions/75287534/indexerror-descartes-polygonpatch-wtih-shapely
I get the error "AttributeError: 'Delaunay' object has no attribute 'vertices'"
Is the .vertices
method deprecated for Delaunay?
Yeah looks like it scipy/scipy@99cc995
Switch to tri.simplices
Yeah looks like it scipy/scipy@99cc995
Switch to tri.simplices
That fixed it. Thanks!
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You can still try, but you may not be able to find an acceptable alpha value. It's been a few years since I was working on this but if I recall correctly, the delaunay triangulation doesn't generate enough triangles to be later pruned, or at least the space between them is not great enough.
Those areas need to be low enough to be less than the inverse of the alpha parameter. I'd step through this in a debugger with your shapefile and see what kind of values you're getting for each triangle to see if you can find a better set of parameters.