-
Notifications
You must be signed in to change notification settings - Fork 62
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
(somewhat) unify OTP and Valhalla api behind "travelmux" service (#326)
Much of the API surface of Valhalla (bike/ped/walk directions) and OTP (transit directions) is very similar, but it's different enough that it requires redundant client implementations - e.g. drawing the routes on the maps is different because the Valhalla and OTP have different conventions for geometry among other things. I initially thought it'd be "real easy" to completely unify the APIs, but there is a lot of information for transit that just doesn't have a great corollary in the non-transit world. Rather than add a bunch of fields that are blank half the time depending on whether you are looking for transit vs. non-transit directions, for now I'm simply including the entirety of the original otp or valhalla request in a subfield for the data which wasn't easy to unify. --- * [transit] version api * DO NOT MERGE: OTP on local port 9001 * WIP: Valhalla integration into transitmux Currently this returns a "one of" response, but it did allow me to plumb through all the configuration we need to talk between OTP and Valhalla. And I did unify the "query" api - though it is limited to the subset of features we currently use. The big remaining thing will be unifying the output so that a transitmux client can render trips from opentripplanner or valhalla with more or less the same code. * [www] nbd: better typing for valhalla client * [www] use transitmux /v2/plan in preparation for unifying valhalla api * [www] nbd: dedupe decode polyline code. I sort of regret it * make raw fields private * WIP: unifying API * wip: unifying clients Currently only `duration` is properly unified but much of the plumbing is in place to gradually merge more fields in. TODO: Basically move the fields in [www] TravelmuxPlan one by one from inner to a locally stored state, updating transitmux as necessary to keep things working. * DO NOT MERGE: dev setup * unify trip.mode * transit displays proper units for walk length * [www] respect units * unify trip overall distance API * unit test against stubbed response * start to unify Legs * unify leg geometry * update deps * unify `start` * Unify mode and line style rendering * keep transit and route specific stuff in their respective Itinerary/Route rather than try to unify everything * handle units Valhalla lets you pick miles/kilometers OTP only ever returns meters At first I thought it would be smart to just always request meters, but then realized that valhalla embeds distance calculations into the localized narrative turn by turn directions, so we can't simply convert it on the front end. Maybe a better approach would be to transform the OTP output to respect the requested units - at least OTP doesn't produce any narrative directions (that we're using anyway). In any case that would be insufficient at this point because we actually still use the raw OTP/Valhalla response for rendering some of the Transit vs. Non-Transit UI. * Cleanup * moving code around * rename transitmux -> travelmux * [docker] fixup terrain.mbtiles in transit compose * travelmux vis a vis docker compose * fixup! rename transitmux -> travelmux * mark integration tests as such * dedupe code * deduping * deduping * sort transit itinerary by arrival time * minimize diff * fixup! rename transitmux -> travelmux * k8s vis a vis travelmux * wip: server side bounds * shoveling code around * fixup! wip: server side bounds * DO NOT MERGE: dev setup * fixup! fixup! wip: server side bounds * rename back to Trip * no integration test setup yet * rename modules since they no longer contain clients * undo some dev changes * hitting this assert - fix it up. * fixup githubworkflow - i disabled features for the wrong crate =/ * fix typo * Surface trip planner errors Before this commit, we weren't surfacing any user visible indication when an error occurs while fetching trips from the OTP or Valhalla API. At some point long ago, we surfaced specific error cases "outside of transit region" but that was broken before travelmux. * simplify and test decodePolyline * remove redundant code * round out method even though we dont use these units... seem like a footgun otherwise * return error rather than panic
- Loading branch information
1 parent
3fa01b8
commit 454985b
Showing
73 changed files
with
8,757 additions
and
1,104 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -35,7 +35,7 @@ images=( | |
pelias-init | ||
tileserver | ||
tileserver-init | ||
transitmux | ||
travelmux | ||
valhalla | ||
valhalla-init | ||
) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 4 additions & 4 deletions
8
k8s/_template/transitmux-deployment.yaml.tpl → k8s/_template/travelmux-deployment.yaml.tpl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
k8s/configs/planet/transitmux-service.yaml → k8s/_template/travelmux-service.yaml.tpl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.