0

With a list of tuple points I am able to create a matplotlib.path.Path object. With a point cloud, I have created a shapely.geometry.Polygon object by using the alphashape.alphashape function.

I would like to convert the Polygon object into a Path object so that I can utilise Path.contains_points which is able to operate on a vector of points instead of Polygon.contains which can only operate on a single point.

Consider the following example:

import alphashape as aps
import matplotlib.path as mpath
import numpy as np
import shapely.geometry as shgt

points = np.random.rand(100,2)
poly = aps.alphashape(points, 0.2) # 0.2 is a toggle param for best concave hull
Tian
  • 870
  • 3
  • 12
  • 24
  • Does this answer your question? [Extract points/coordinates from a polygon in Shapely](https://stackoverflow.com/questions/20474549/extract-points-coordinates-from-a-polygon-in-shapely) – Georgy Jan 28 '20 at 10:33
  • @Georgy thanks for the link. I was wondering whether there was a more direct method – Tian Jan 28 '20 at 11:47

0 Answers0