Network Analysis, Python, Qgis.
have and use the nearest_nodes function of OSMnx to identify the nodes closest to each point. X0 = 51.76022, -1.80555 # Point A X1 = 53.89806, -1.51252 # Point B node = ox.nearest_nodes(Gp, X0, X1) X0_node = [i for i, x in enumerate(list(Gp)) if x == node[0]] X1_node = [i for i, x in