MCPcopy Create free account
hub / github.com/Project-OSRM/osrm-backend / expand_nodes

Function expand_nodes

scripts/debug/dump_hsgr.py:151–164  ·  view source on GitHub ↗

ebg_nodes is a run-length-encoded list of nodes. The start nodes in the hsgr edge list are are sorted, ascending, with duplicates. The first entry in ebg_nodes contains the position where the first node starts in ebg_edges, the second entry the position where the second node starts, etc

(ebg_nodes, ebg_edges)

Source from the content-addressed store, hash-verified

149
150
151def expand_nodes(ebg_nodes, ebg_edges):
152 """ebg_nodes is a run-length-encoded list of nodes.
153
154 The start nodes in the hsgr edge list are are sorted, ascending, with duplicates.
155 The first entry in ebg_nodes contains the position where the first node starts in
156 ebg_edges, the second entry the position where the second node starts, etc."""
157 node = -1
158 (next_node,) = next(ebg_nodes)
159 for pos, e in enumerate(ebg_edges):
160 while pos == next_node:
161 node += 1
162 (next_node,) = next(ebg_nodes)
163 e.source = node
164 yield e
165
166
167def read_hsgr_file(args):

Callers 1

read_hsgr_fileFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected