Add mapbox map-matching - #45
Open
mattpodwysocki wants to merge 1 commit into
Open
mattpodwysocki wants to merge 1 commit into
mattpodwysocki wants to merge 1 commit into
Conversation
This was referenced Sep 24, 2026
mattpodwysocki
force-pushed
the
feat/isochrone-api
branch
from
September 25, 2026 14:52
bd00deb to
16e44ed
Compare
Third of the Navigation-category APIs with no prior CLI coverage. Same shape as directions/isochrone (#43, #44): hand-authored into custom-openapi/ since openapi-specs has no spec for this API either, reusing ARG_NAME_OVERRIDES for the same profile-vs-global-flag collision (third row, not a third mechanism). Excludes POST, for the same documented reason directions route does: this spec format can't express "GET or POST, caller's choice" for one operationId, and the API's own POST exists specifically for a trace too long for a URL (~8100 bytes) — a real gap, not a design choice. Smoke-tested against production: a three-point San Francisco trace returned a real match with legs/steps/geometry, including a null tracepoint for a point too far from the road network to match — the documented shape for that case, not a bug. 486 tests, fmt and clippy clean. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
mattpodwysocki
force-pushed
the
feat/map-matching-api
branch
from
September 25, 2026 14:56
21ec4b4 to
232803a
Compare
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Same stacking situation as #44 on #43. This reuses the flattening mechanism
(
spec::FLATTENED_SERVICES),ARG_NAME_OVERRIDES, and thepath_segment_for/UNESCAPED_PATH_PARAMSfix #43 introduces, since everyone of these Navigation APIs'
profilepath parameter hits the sameglobal-flag collision and needs the same free-form profile. Once #43 and
#44 merge in order, this should be retargeted to
main(gh pr edit --base main). Everything below is scoped to what this PR actually adds on top of#44.
What
mapbox map-matching, the third Navigation-category API with no priorCLI coverage. Same shape as #43/#44: hand-authored into
custom-openapi/since openapi-specs publishes no spec for it either.
No subcommand: like
mapbox directionsandmapbox isochrone, this APIhas one operation, so there's nothing a second word (the old
match)would disambiguate. Same shape
mapbox usagealready has.Snaps a noisy GPS trace to the road network and returns the route it most
likely followed, for driving (with or without live traffic), walking, or
cycling. One or more matched routes (more than one where the trace is
ambiguous enough to split), each with a
confidence, plus one tracepointper input coordinate (
nullfor one too far from any candidate to match atall).
Excluded on purpose: POST, for the same reason
directionsexcludesit. This spec format has no way to express "GET or POST, caller's choice"
for one operationId. The API's own POST exists specifically for a trace
too long for a URL (~8100 bytes), a real gap for a very long trace rather
than a design choice.
Routing profile is free-form here too
Same fix as #43 and #44: an earlier version of this command validated
profileagainst the four documented values client-side, via a clap enum.Some OEM accounts have additional profiles that aren't published, so that
validation would have broken this command for exactly the accounts that
most need it.
profileis now sent exactly as typed, and reaches the URLunescaped through
UNESCAPED_PATH_PARAMS(("map-matching", "profile")).Verification
Smoke-tested against production: a three-point San Francisco trace
returned a real match with
legs/steps/geometry, including anulltracepoint for a point deliberately placed too far from the road network to
match, the documented shape for that case, confirmed rather than assumed.
The bare
mapbox map-matchingcommand shape itself is also verified (nosubcommand accepted,
--schemareflects the new name).489 tests,
cargo fmt --checkandcargo clippy --all-targets -- -D warningsboth clean.🤖 Generated with Claude Code