Here is my attempt, but I get the error
"AttributeError: 'numpy.ndarray' object has no attribute 'contains'"
.
If any of you can help me to understand how to define 'y'
in this code such that it is a numpy array with 1s corresponding to the index of polygons that contain the specified point and 0s corresponding to the index of polygons that do not contain the specified point I would appreciate it.
polygonss=[]
for i in range(0, len(verts)):
polygonc = Polygon(verts[i])
print (polygonc)
polygonss.append(polygonc)
print (polygonss)
p=np.array(polygonss)
print (p)
vertsf=meshinformation_fine.celltoverticesandcentroid(0)[0]
point = Point(vertsf[0])
y=np.where(p.contains(point), 0, 1)
print (y)