From c2878e7ff1c70e681fc7d09e73f352bb4cf6d6d7 Mon Sep 17 00:00:00 2001 From: napakalas Date: Wed, 11 Dec 2024 16:20:34 +1300 Subject: [PATCH 1/2] Pass paths's label to route_graph --- mapmaker/routing/__init__.py | 1 + 1 file changed, 1 insertion(+) diff --git a/mapmaker/routing/__init__.py b/mapmaker/routing/__init__.py index d937d71a..b49cd9cb 100644 --- a/mapmaker/routing/__init__.py +++ b/mapmaker/routing/__init__.py @@ -1355,6 +1355,7 @@ def set_properties_from_feature_id(feature_id: str): feature.pop_property('exclude') route_graph.graph['path-id'] = path.id + route_graph.graph['label'] = path.label route_graph.graph['path-type'] = path.path_type route_graph.graph['source'] = path.source route_graph.graph['traced'] = path.trace From 3ed3f0a28fe8326461d17ab52ed653edb4e68024 Mon Sep 17 00:00:00 2001 From: napakalas Date: Wed, 11 Dec 2024 16:30:01 +1300 Subject: [PATCH 2/2] Assign routed_graph label to added_properties --- mapmaker/routing/routedpath.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/mapmaker/routing/routedpath.py b/mapmaker/routing/routedpath.py index 60a6d4d5..b84d16d9 100644 --- a/mapmaker/routing/routedpath.py +++ b/mapmaker/routing/routedpath.py @@ -453,7 +453,10 @@ def draw_line(node_0, node_1, added_properties, tolerance=0.1, separation=2000): for node_0, node_1, edge_dict in self.__graph.edges(data=True): ## This assumes node_1 is the terminal... path_id = edge_dict.get('path-id') path_source = edge_dict.get('source') - added_properties = {'completeness': edge_dict.get('completeness', True)} + added_properties = { + 'completeness': edge_dict.get('completeness', True), + 'label': self.__graph.graph.get('label') + } if (missing_nodes:=edge_dict.get('missing_nodes')) is not None: added_properties['missing-nodes'] = missing_nodes if (alert:=self.__graph.graph.get('alert')) is not None: