0 values while getting way_id along the route
- Dominant language
- C++
- Stars
- 6.2k
- Forks
- 981
- Avg merge
- 2d 14h
- Merged PRs (30d)
- 14
Description
Hello!
I'm trying to get a list of original way_ids along the route.
But the result has some way_ids equal to 0.
E.g.: [1323, 3432, 234324, 8744, **0, 0**, 3434, 7586, 23424]
This leads to gaps in my route during route postprocessing.
However valhalla total route geometry is full and correct.
By the way another route passing those edges give correct way_ids. Zeroes could appeared in another part of the route.
I use following code to retrieve original way_ids from trip:
```C++
json::ArrayPtr
edges(const valhalla::Trip& trip) {
auto edges = json::array({});
for (const auto& leg : trip.routes(0).legs()) {
for (const auto& leg_node : leg.node()) {
if (leg_node.has_edge()) {
if (leg_node.edge().has_way_id())
edges->emplace_back(leg_node.edge().way_id());
}
}
}
return edges;
}
```
Is there the correct way to get way_ids of the route?
Any ideas where the problem could be?
Contributor guide
Research direction
Start with the C++ edges() traversal shown in the report and trace how Trip route legs populate edge way_id values. Compare the listed route with another route over the same edges, then establish whether zero way_ids are expected or indicate missing data; done means identifying the cause and documenting or correcting the behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100