This thread here gave a solution of how to determine if a geopandas
POINT
is in a solid POLYGON
.
What would be a generic solution to determine this for a POLYGON
with holes, i.e. MULTIPOLYGON
.
For e.g., using foo
below:
from shapely.geometry import Point, Polygon
import geopandas
polys = geopandas.GeoSeries({
'foo': Polygon([(5, 5), (5, 13), (13, 13), (13, 5)],
[[(7, 7), (7, 11), (11, 11), (11, 7)]]),
'bar': Polygon([(10, 10), (10, 15), (15, 15), (15, 10)]),
})
_pnts = [Point(3, 3), Point(8, 8), Point(11, 11)]
pnts = geopandas.GeoDataFrame(geometry=_pnts, index=['A', 'B', 'C'])