Skip to content

Commit

Permalink
Update candidate.py
Browse files Browse the repository at this point in the history
  • Loading branch information
matteotortora committed Oct 19, 2022
1 parent ad5107b commit b3f1516
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion pytrack/matching/candidate.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,11 @@ def get_candidates(G, points, interp_dist=1, closest=True, radius=10):
G = G.copy()

if interp_dist:
G = distance.interpolate_graph(G, dist=interp_dist)
if G.graph["geometry"]:
G = distance.interpolate_graph(G, dist=interp_dist)
else:
_ = utils.graph_to_gdfs(G, nodes=False)
G = distance.interpolate_graph(G, dist=interp_dist)

geoms = utils.graph_to_gdfs(G, nodes=False).set_index(["u", "v"])[["osmid", "geometry"]]

Expand Down

0 comments on commit b3f1516

Please sign in to comment.