Good Julia function / algorithm idea to find the nearest node to a given point location based on some given road network (for example, open street map data)?

Hi @pszufe, I have around 8M coordinates I’d like to associate with nearest node on an OpenStreetMapX with around 800,000 nodes, but I’m finding it hard to compute even 10,000 points. Here is a graph of benchmarks

computed like this:
b4 = @benchmark [ point_to_nodes(pt, mad) for pt in ptsOrig ] setup=(ptsOrig = zip($(df.dLat[1:10_000]), $(df.dlng[1:10_000])))

Is there a quick way around this? if spatial indexing is the only solution, there’s a native Julia option here GitHub - alyst/SpatialIndexing.jl: Spatial data indexing in pure Julia (R*-trees etc) and others listed here https://juliageo.org/

Do you recommend any one in particular nowadays and is there a quick tutorial somewhere as to how to build the index given an OpenStreetMap and any of these libraries?

Thanks in advance.