3

I need the 'concave hull' or alphashape of a set of points. Also, I'd like to have it with holes/donuts/islands in the middle. See my attached image. The outer hull is being calculated fine. But the large islands in the middle are generated as part of the hull. I want to get rid of that.

My code (partially grabbed from tutorials all around) can be found here: https://gist.github.com/willemvanopstal/f199c2f839b4de2abadfafde450c45ed

enter image description here

I expect it to be a simple mistake from my side.. Maybe in generating the resulting polygon from the isolated edges; (edge_points are the edges which have passed the alpha-test)

m = geometry.MultiLineString(edge_points)
triangles = list(polygonize(m))
return cascaded_union(triangles), edge_points

Is there anybody who knows a fix for my issue?

  • 1
    Have you considered to make separate alpha hulls for the outer ring and inner rings and compute difference as the final step? – user30184 Sep 28 '17 at 6:09
  • @user30184 That's what I'd do. – Fezter Sep 29 '17 at 3:12
  • This won't work with point features. Your set of points won't have any defined 'inner' or 'outer' geometry because it is just a bunch of points. Points aren't organized into inner and outer geometries like polygons. – onakua Dec 24 '17 at 1:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.