I have a streets line dataset and a GPS Ping point dataset which contains speed. I'm trying to join the points to the closest street within 15m to get an average speed along each segment.
More details: The larger intent of the project is to train a model to predict the speed for each segment based on a number of attributes in the streets dataset. From a processing perspective, this is a pretty large dataset with roughly 1 million line segments, and 400,000 GPS Ping points.
A small example area looks like this:
I have added a 15m buffer around each point. I don't want to include the ones further than 15m from a line segment, and if a point is within 15 of multiple segments it is attached to the closest one.
So far my code looks like this:
import geopandas as gpd gdb = r"C:\aaa\harry\model_training\data.gdb" rtsFC = "RTS_Pings_cut2" streetsFC = "streets_cut2" rtsGDF = gpd.read_file(gdb, driver='FileGDB', layer=rtsFC) streetsGDF = gpd.read_file(gdb, driver='FileGDB', layer=streetsFC) streetsGDF.set_crs("EPSG:3111")
Then I am lost.