I have a set of lat,long points, and from this points I'd like to extract the points that form the boundaries, I've used convexhull, but for my purpouse is not enough as convehull just returns the most distant points that form the polygon where all the points fit, I need ALL the points that form the peremiter, something like the image I've attached. What could I do? Is there some kind of package ready to use instead of implement any spatial algorithm? Thanks
Boundary of a Set. A point x is a boundary point of a set A ⊂ X if there are points arbitrarily close to x that are in A and if there are points arbitrarily close to x that are in X but not in A. Example: The set A = {(x, y) ∈ R2 : x2 + y2 < 1}.
Boundary of 2-D Point Cloud Create and plot a set of random 2-D points. Compute a boundary around the points using the default shrink factor. k = boundary(x,y); hold on; plot(x(k),y(k)); Create a new boundary around the points using a shrink factor of 0.1.
You must use a package for convex polygons. Here is an example:
import alphashape
import matplotlib.pyplot as plt
points = put your points here (can be array)!
alpha = 0.95 * alphashape.optimizealpha(points)
hull = alphashape.alphashape(points, alpha)
hull_pts = hull.exterior.coords.xy
fig, ax = plt.subplots()
ax.scatter(hull_pts[0], hull_pts[1], color='red')
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With