Side of the Road Routing Preference

By default, the Navigation SDK for Android finds the quickest route to a waypoint, however this doesn't guarantee that the vehicle will arrive on the side of the road that the consumer is waiting on. The Side of the Road Routing Preference feature allows you to ensure that the vehicle arrives on the correct side of the road.

How it works

You set the preference for arriving on a particular side of the road when you create the waypoint for that stop. You can specify the preference in one of two ways.

Prefer the same side of the road

You provide the geographic coordinates of the waypoint, and then set a flag (setPreferSameSideOfRoad) that indicates that you prefer to arrive on the same side of the road as the waypoint—snapped to the nearest sidewalk.

Waypoint waypoint =
   Waypoint.builder()
           .setLatLng(latitude, longitude)
           .setTitle("Somewhere in Sydney")
           .setPreferSameSideOfRoad(true)
           .build()

Set the arrival heading

You provide the geographic coordinates of the waypoint, and then provide an arrival heading (setPreferredHeading) that matches the direction of traffic flow on the same side of the road as the waiting consumer.

Waypoint waypoint =
   Waypoint.builder()
           .setLatLng(latitude, longitude)
           .setTitle("Somewhere in Sydney")
           .setPreferredHeading(preferredHeading)
           .build()

The Navigation SDK for Android chooses the road segment closest to the waypoint—that has a lane direction that aligns (within +/- 55 degrees) with the side of the road that the waypoint is on.