Return List Of Points Within Polygon Geopandas
I have a shapefile of London with over 4000 unique polygons representing lsoa areas. I have also created a geodataframe of points representing sensors in the city. I need to work o
Solution 1:
I have found a very simple solution using a spatial join as follows:
merge = gpd.sjoin(map_df, sensors, how="right", op='contains')
index_left LSOA11CD LSOA11NM pod_id_location Borough Latitude Longitude geometry
index_right
0 199 E01000204 Barnet 025C 1245 Barnet 51.604486 -0.206551 POINT (-0.20655 51.60449)
1 897 E01000915 Camden 027A 2245 Camden 51.521880 -0.120434 POINT (-0.12043 51.52188)
Post a Comment for "Return List Of Points Within Polygon Geopandas"