mapbox / mapbox-navigation-android

Mapbox Navigation SDK for Android
https://docs.mapbox.com/android/navigation/overview/
Other
622 stars 319 forks source link

Issues using MapboxMapMatching routes #4780

Open RoProducts opened 3 years ago

RoProducts commented 3 years ago

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<DirectionsRoute> = 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

stale[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

RoProducts commented 2 years ago

Well, at least a reaction would be great.