I have a dataframe from which I created a Multipoint object:
points = MultiPoint(list(zip(dfxT['x'], dfxT['y'])))
The dfxT looks like this:
x | y | xT
2 3 1
2 15 5
2 28 6
And this is the Multipoint output:
And now I have a new tuple of coordinates and I want to check if they lie inside the Multipoint object and then get the x and y and retrieve the correspondant xT from the dataframe.
So basically I did this:
p = Point(10, 42)
a = points.intersection(p)
which returns nothing. I guess I am trying to see if the point is inside the multipoint and to get what I want I think I should get the closest point and .loc it on my dataframe.
So the question is: How do I get the x and y coordinates from the closest Point inside a Multipoint ?
