Skip to content

Commit

Permalink
Merge branch 'main' of github.com:AnatomicMaps/flatmap-maker
Browse files Browse the repository at this point in the history
  • Loading branch information
dbrnz committed Sep 12, 2024
2 parents a0ff934 + 80c0fb0 commit 4503fb4
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions mapmaker/routing/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -1059,6 +1059,13 @@ def get_centreline_from_containing_features(start_dict, end_dict, feature_ids: s
candidates[(n,s)] = nf.geometry.centroid.distance(sf.geometry.centroid)
tmp_edge_dicts[(n,s)] = edge_dict
new_direct_edges.update([min(candidates, key=candidates.get)]) # type: ignore
elif ((p_dict:=connectivity_graph.nodes[prev_node])['type'] == 'feature' and
(n_dict:=connectivity_graph.nodes[node])['type'] == 'feature'):
if ((pf:=list(p_dict.get('features'))[0].id) in route_graph.nodes and
(nf:=list(n_dict.get('features'))[0].id) in route_graph.nodes):
edge_dict = connectivity_graph.edges[(prev_node, node)]
tmp_edge_dicts[(pf, nf)] = edge_dict
new_direct_edges.update([(pf, nf)])
prev_node = node

if len(feature_ids):
Expand Down

0 comments on commit 4503fb4

Please sign in to comment.