mapbox / mapbox-navigation-android

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

Mapbox with Walking profile doesn't draw route on pedestrian path if user is located on the Main street (i.e. Driving path) #4555

Open shreya-ja opened 3 years ago

shreya-ja commented 3 years ago

Android API: 29 Mapbox Maps SDK version: 9.6.1 Mapbox Navigation UI SDK version: 1.5.1

I was exploring MapBox Direction API using Walking profile and experienced the following issue

In direction API, if my start location is located on main street, then route is drawn on the main street. I have configured my code with Walking profile hence my route should not be drawn on main street at any cost, as route should always be drawn according to nearest pedestrian path.

I checked above scenario in Google and found working as expected. Please let me know if this is a bug in MapBox Direction API or am I missing any configuration in my code?

Steps to trigger behavior

  1. User's current location is on main street rather than on sidewalk.
  2. Using Mapbox Walking profile, the route shall be drawn including sidewalk and crosswalk for user's safety

Location - Chicago, USA Direction API Request

Case 1: If start & destination coordinate is on main street and not on Sidewalk Start Coordinate - 41.90084455967382, -87.6232866902274 Destination Coordinate - 41.900860585647926, -87.6252983194398

Case 2: If start coordinate is on main street & destination coordinate is on Sidewalk Note: Snapshot attached is of this case Start Coordinate - 41.90084455967382, -87.6232866902274 Destination Coordinate - 41.90086457822011, -87.62527686154802 ` val walking: WalkingOptions = WalkingOptions.builder().alleyBias(1.0).walkwayBias(1.0).build()

mapboxNavigation.requestRoutes( RouteOptions.builder() .accessToken(accessToken) .baseUrl(RouteUrl.BASE_URL) .user(RouteUrl.PROFILE_DEFAULT_USER) .requestUuid("") .coordinates(listOf(coordinateList.first(), coordinateList.last())) .geometries(RouteUrl.GEOMETRY_POLYLINE6) .profile(RouteUrl.PROFILE_WALKING) .steps(true) .overview(RouteUrl.OVERVIEW_FULL) .bannerInstructions(true) .walkingOptions(walking) .build(), routesReqCallback )

`

Expected behavior

If the route is fetched using Mapbox Walking profile, then routes shall be drawn on the pedestrian path.

Actual behavior

Route is not drawn on sidewalk if start and destination location is present on main street.

ROUTE_NOT_DRAWN_ON_SIDEWALK

1ec5 commented 2 years ago

This would be the behavior of the Directions API’s walking profile (and Valhalla under the hood). @browndp08 can someone on your team confirm if this is still the case? Thanks!

1ec5 commented 2 years ago

I’ve opened an internal issue to track enhancing the Directions API’s underlying routing engine to account for separately drawn sidewalk ways when snapping waypoints.