Add ability to override congestion levels for specific road classes.#2741
Conversation
11eb7e3 to
ceb649e
Compare
|
OfflineRoutingTests is failing because of a decoding error that would probably be fixed by mapbox/mapbox-directions-swift#485: |
Yep, I've seen that. Since current PR already depends on |
c512422 to
cbc2f49
Compare
|
@1ec5, can you please take a look at this PR once more? |
There was a problem hiding this comment.
I think RouteLeg.segmentRangesByStep may simplify this computation.
There was a problem hiding this comment.
Seems that segmentRangesByStep is not detailed enough, as it stores only lower and upper bounds. segmentIndicesByIntersection is more precise in this case, as it stores segment indices for Intersection.
91a5c64 to
02aaeb0
Compare
There was a problem hiding this comment.
At a glance, it seems like this calculation would be simplified by zipping segmentIndices, but it’s hard to be sure. I’m a bit wary of the manual index arithmetic, but I trust you’ve already tested the multi-leg route edge case. I can’t think of any other edge cases at the moment.
There was a problem hiding this comment.
Just tried several approaches with zipping and striding, but seems that it doesn't help to make this code more elegant and simple. I propose to move on with landing this PR so that we can start testing and I can follow-up with any better solutions in future PRs.
…emove unused `trafficAlternateLow` property. Remove unused `.gitignore` file.
…denCongestionLevels`.
b87b6df to
bf436db
Compare
Description
This PR implements the ability to override congestion levels for specific road classes.
Implementation
Since implementation is using Mapbox Directions property
RouteStep.segmentIndicesByIntersectionit depends on branchvk/478-intersection-geometry. Dependency will be updated after dependent branch is merged tomain.Since Android implementation is using road classes from
mapbox_streets_v8there is slight difference between congestion segments. After iOS is done with implementing same functionality current implementation should re-tested and revised once more.Update: Most recent version was updated and is currently using
MapboxStreetsRoadClasswhich matches Android implementation.Screenshots or Gifs
Screenshots show congestion consistency comparison between iOS and Android. In this example
.unknowncongestion level for.motorwayroad class is replaced to.low(blue color). Currently there is slight shift of color because of gradient which is used on iOS.