I have two lists of points (latitudes, longitudes) - locations & events:
locations = [[54.156014, 53.017209], [2.74284, 103.68141], [3.133688, 102.688424], [24.499918, 55.388891], [21.488382, 61.395062], [24.479778, 59.354986], [25.180161, 78.269545], [-31.5796783, -58.5812265]]
events = [[-15.794157, -47.882529],[33.319392, 44.347046],[26.225653, 50.535556],[50.447336, 30.536875],[50.447336, 30.536875],[50.442721, 30.52179],[50.442721, 30.52179],[-15.794157, -47.882529],[3.848032, 11.502075],[-12.97304, -38.502304],[26.226559, 50.54591],[-34.603684, -58.381559],[32.094771, 20.187911],[48.868472, 2.330211],[-30.032056, -51.208428],[32.887209, 13.191338],[13.767966, 100.534526],[-34.92849, 138.60074],[32.887209, 13.191338],[26.230536, 50.527792],[50.4501, 30.5234],[50.4501, 30.5234],[50.442721, 30.52179],[50.442721, 30.52179],[50.447137, 30.537357],[50.447137, 30.537357],[12.81063, 45.035019],[26.225653, 50.535556],[-12.97304, -38.502304],[26.226559, 50.54591],[35.675888, 139.744858],
[12.813674, 45.034161],[54.156014, 53.017210]]
I would like to check which of the events occurred in the 2 kilometer radius buffer from locations.
If one event occurred in multiple buffers I would like to have this event attached to multiple locations that it occurred in the nearby.
What I have tried: I have converted locations list and events list to dataframes and did following:
locations_gpd = gpd.GeoDataFrame(locations, geometry=gpd.points_from_xy(locations.longitude, locations.lattitude).buffer(2, 16), crs = {'init':'epsg:4326'})
events_gpd = gpd.GeoDataFrame(events, geometry=gpd.points_from_xy(events.longitude, events.latitude), crs = {'init':'epsg:4326'})
intersection = gpd.sjoin(locations_gpd, events_gpd, how='left')
This actually performs the intersection well, but the buffer zone is bigger than 2km (I plotted the results and can see on the map) I cant figure out how to apply correct distance/resolution parameters (2km) in GeoDataFrame.buffer(distance, resolution)
PS. I am beginner with GeoPandas, could you give me a lead how to perform this intersection?