Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Boundary points from a set of coordinates

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 enter image description here

like image 845
Karlovalentin Avatar asked Jun 21 '17 19:06

Karlovalentin


People also ask

How do you find the boundary points of a set?

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}.

How do you plot boundary points in Matlab?

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.


1 Answers

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')   
like image 137
Augusto César Avatar answered Oct 21 '22 10:10

Augusto César