mapbox / mapbox/mapbox-navigation-android
Issues using MapboxMapMatching routes
Nobody has claimed this yet.
- Dominant language
- Kotlin
- Stars
- 651
- Forks
- 321
- PR merge metrics
- No merged PRs in 30d
Description
Hi,
we want to navigate using the Navigation UI SDK version 1.5.1
Besides com.mapbox.api.directions.v5.MapboxDirections routes, we want to use routes from other providers or GPX files.
We use com.mapbox.api.matching.v5.MapboxMapMatching to convert such coordinate lists to com.mapbox.api.directions.v5.models.DirectionsRoute like :
val request = MapboxMapMatching.builder()
.accessToken(Constants.MAPBOX_TOKEN)
.coordinates(positions)
.steps(true)
.voiceInstructions(true)
.bannerInstructions(true)
.profile(DirectionsCriteria.PROFILE_CYCLING)
.build()
The matching is successful and we want to use the route in a navigation like :
val no = NavigationOptions.Builder(App.get().applicationContext)
.accessToken(Constants.MAPBOX_TOKEN)
.distanceFormatter(distanceFormatter)
.isDebugLoggingEnabled(true)
.isFromNavigationUi(true)
.isRouteRefreshEnabled(true)
.build()
mapboxNavigation = MapboxNavigation(no)
[...]
val routes: MutableList = ArrayList()
routes.add(route)
mapboxNavigation?.setRoutes(routes)
mapboxNavigation?.startTripSession()
However, when navigating we are getting wrong route progress information like "You'll arrive" as first banner instruction.
The route contains legs in the correct order, however compared to a route created with com.mapbox.api.directions.v5.MapboxDirections which contains only one Leg with plenty steps, the matched route contains plenty of legs having only always two steps.
Can you resolve what goes wrong or what we are doing wrong ?
Thank you
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing the MapboxMapMatching request through setRoutes(routes) and startTripSession(), comparing the matched route's legs and steps with a MapboxDirections route. Check how the first banner instruction and route progress are derived; done means matched routes produce correct navigation progress and instructions.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- kotlin
- Domain
- mobile
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100