public interface RouteOrBuilder
extends com.google.protobuf.MessageOrBuilder
| Modifier and Type | Method and Description |
|---|---|
String |
getDescription()
A description of the route.
|
com.google.protobuf.ByteString |
getDescriptionBytes()
A description of the route.
|
int |
getDistanceMeters()
The travel distance of the route, in meters.
|
com.google.protobuf.Duration |
getDuration()
The length of time needed to navigate the route.
|
com.google.protobuf.DurationOrBuilder |
getDurationOrBuilder()
The length of time needed to navigate the route.
|
RouteLeg |
getLegs(int index)
A collection of legs (path segments between waypoints) that make up the
route.
|
int |
getLegsCount()
A collection of legs (path segments between waypoints) that make up the
route.
|
List<RouteLeg> |
getLegsList()
A collection of legs (path segments between waypoints) that make up the
route.
|
RouteLegOrBuilder |
getLegsOrBuilder(int index)
A collection of legs (path segments between waypoints) that make up the
route.
|
List<? extends RouteLegOrBuilder> |
getLegsOrBuilderList()
A collection of legs (path segments between waypoints) that make up the
route.
|
Route.RouteLocalizedValues |
getLocalizedValues()
Text representations of properties of the `Route`.
|
Route.RouteLocalizedValuesOrBuilder |
getLocalizedValuesOrBuilder()
Text representations of properties of the `Route`.
|
int |
getOptimizedIntermediateWaypointIndex(int index)
If you set
[`optimize_waypoint_order`][google.maps.routing.v2.ComputeRoutesRequest.optimize_waypoint_order]
to true, this field contains the optimized ordering of intermediate
waypoints.
|
int |
getOptimizedIntermediateWaypointIndexCount()
If you set
[`optimize_waypoint_order`][google.maps.routing.v2.ComputeRoutesRequest.optimize_waypoint_order]
to true, this field contains the optimized ordering of intermediate
waypoints.
|
List<Integer> |
getOptimizedIntermediateWaypointIndexList()
If you set
[`optimize_waypoint_order`][google.maps.routing.v2.ComputeRoutesRequest.optimize_waypoint_order]
to true, this field contains the optimized ordering of intermediate
waypoints.
|
Polyline |
getPolyline()
The overall route polyline.
|
PolylineDetails |
getPolylineDetails()
Contains information about details along the polyline.
|
PolylineDetailsOrBuilder |
getPolylineDetailsOrBuilder()
Contains information about details along the polyline.
|
PolylineOrBuilder |
getPolylineOrBuilder()
The overall route polyline.
|
RouteLabel |
getRouteLabels(int index)
Labels for the `Route` that are useful to identify specific properties
of the route to compare against others.
|
int |
getRouteLabelsCount()
Labels for the `Route` that are useful to identify specific properties
of the route to compare against others.
|
List<RouteLabel> |
getRouteLabelsList()
Labels for the `Route` that are useful to identify specific properties
of the route to compare against others.
|
int |
getRouteLabelsValue(int index)
Labels for the `Route` that are useful to identify specific properties
of the route to compare against others.
|
List<Integer> |
getRouteLabelsValueList()
Labels for the `Route` that are useful to identify specific properties
of the route to compare against others.
|
String |
getRouteToken()
An opaque token that can be passed to [Navigation
SDK](https://developers.google.com/maps/documentation/navigation) to
reconstruct the route during navigation, and, in the event of rerouting,
honor the original intention when the route was created.
|
com.google.protobuf.ByteString |
getRouteTokenBytes()
An opaque token that can be passed to [Navigation
SDK](https://developers.google.com/maps/documentation/navigation) to
reconstruct the route during navigation, and, in the event of rerouting,
honor the original intention when the route was created.
|
com.google.protobuf.Duration |
getStaticDuration()
The duration of travel through the route without taking traffic
conditions into consideration.
|
com.google.protobuf.DurationOrBuilder |
getStaticDurationOrBuilder()
The duration of travel through the route without taking traffic
conditions into consideration.
|
RouteTravelAdvisory |
getTravelAdvisory()
Additional information about the route.
|
RouteTravelAdvisoryOrBuilder |
getTravelAdvisoryOrBuilder()
Additional information about the route.
|
com.google.geo.type.Viewport |
getViewport()
The viewport bounding box of the polyline.
|
com.google.geo.type.ViewportOrBuilder |
getViewportOrBuilder()
The viewport bounding box of the polyline.
|
String |
getWarnings(int index)
An array of warnings to show when displaying the route.
|
com.google.protobuf.ByteString |
getWarningsBytes(int index)
An array of warnings to show when displaying the route.
|
int |
getWarningsCount()
An array of warnings to show when displaying the route.
|
List<String> |
getWarningsList()
An array of warnings to show when displaying the route.
|
boolean |
hasDuration()
The length of time needed to navigate the route.
|
boolean |
hasLocalizedValues()
Text representations of properties of the `Route`.
|
boolean |
hasPolyline()
The overall route polyline.
|
boolean |
hasPolylineDetails()
Contains information about details along the polyline.
|
boolean |
hasStaticDuration()
The duration of travel through the route without taking traffic
conditions into consideration.
|
boolean |
hasTravelAdvisory()
Additional information about the route.
|
boolean |
hasViewport()
The viewport bounding box of the polyline.
|
findInitializationErrors, getAllFields, getDefaultInstanceForType, getDescriptorForType, getField, getInitializationErrorString, getOneofFieldDescriptor, getRepeatedField, getRepeatedFieldCount, getUnknownFields, hasField, hasOneofList<RouteLabel> getRouteLabelsList()
Labels for the `Route` that are useful to identify specific properties of the route to compare against others.
repeated .google.maps.routing.v2.RouteLabel route_labels = 13;int getRouteLabelsCount()
Labels for the `Route` that are useful to identify specific properties of the route to compare against others.
repeated .google.maps.routing.v2.RouteLabel route_labels = 13;RouteLabel getRouteLabels(int index)
Labels for the `Route` that are useful to identify specific properties of the route to compare against others.
repeated .google.maps.routing.v2.RouteLabel route_labels = 13;index - The index of the element to return.List<Integer> getRouteLabelsValueList()
Labels for the `Route` that are useful to identify specific properties of the route to compare against others.
repeated .google.maps.routing.v2.RouteLabel route_labels = 13;int getRouteLabelsValue(int index)
Labels for the `Route` that are useful to identify specific properties of the route to compare against others.
repeated .google.maps.routing.v2.RouteLabel route_labels = 13;index - The index of the value to return.List<RouteLeg> getLegsList()
A collection of legs (path segments between waypoints) that make up the route. Each leg corresponds to the trip between two non-`via` [`Waypoints`][google.maps.routing.v2.Waypoint]. For example, a route with no intermediate waypoints has only one leg. A route that includes one non-`via` intermediate waypoint has two legs. A route that includes one `via` intermediate waypoint has one leg. The order of the legs matches the order of waypoints from `origin` to `intermediates` to `destination`.
repeated .google.maps.routing.v2.RouteLeg legs = 1;RouteLeg getLegs(int index)
A collection of legs (path segments between waypoints) that make up the route. Each leg corresponds to the trip between two non-`via` [`Waypoints`][google.maps.routing.v2.Waypoint]. For example, a route with no intermediate waypoints has only one leg. A route that includes one non-`via` intermediate waypoint has two legs. A route that includes one `via` intermediate waypoint has one leg. The order of the legs matches the order of waypoints from `origin` to `intermediates` to `destination`.
repeated .google.maps.routing.v2.RouteLeg legs = 1;int getLegsCount()
A collection of legs (path segments between waypoints) that make up the route. Each leg corresponds to the trip between two non-`via` [`Waypoints`][google.maps.routing.v2.Waypoint]. For example, a route with no intermediate waypoints has only one leg. A route that includes one non-`via` intermediate waypoint has two legs. A route that includes one `via` intermediate waypoint has one leg. The order of the legs matches the order of waypoints from `origin` to `intermediates` to `destination`.
repeated .google.maps.routing.v2.RouteLeg legs = 1;List<? extends RouteLegOrBuilder> getLegsOrBuilderList()
A collection of legs (path segments between waypoints) that make up the route. Each leg corresponds to the trip between two non-`via` [`Waypoints`][google.maps.routing.v2.Waypoint]. For example, a route with no intermediate waypoints has only one leg. A route that includes one non-`via` intermediate waypoint has two legs. A route that includes one `via` intermediate waypoint has one leg. The order of the legs matches the order of waypoints from `origin` to `intermediates` to `destination`.
repeated .google.maps.routing.v2.RouteLeg legs = 1;RouteLegOrBuilder getLegsOrBuilder(int index)
A collection of legs (path segments between waypoints) that make up the route. Each leg corresponds to the trip between two non-`via` [`Waypoints`][google.maps.routing.v2.Waypoint]. For example, a route with no intermediate waypoints has only one leg. A route that includes one non-`via` intermediate waypoint has two legs. A route that includes one `via` intermediate waypoint has one leg. The order of the legs matches the order of waypoints from `origin` to `intermediates` to `destination`.
repeated .google.maps.routing.v2.RouteLeg legs = 1;int getDistanceMeters()
The travel distance of the route, in meters.
int32 distance_meters = 2;boolean hasDuration()
The length of time needed to navigate the route. If you set the `routing_preference` to `TRAFFIC_UNAWARE`, then this value is the same as `static_duration`. If you set the `routing_preference` to either `TRAFFIC_AWARE` or `TRAFFIC_AWARE_OPTIMAL`, then this value is calculated taking traffic conditions into account.
.google.protobuf.Duration duration = 3;com.google.protobuf.Duration getDuration()
The length of time needed to navigate the route. If you set the `routing_preference` to `TRAFFIC_UNAWARE`, then this value is the same as `static_duration`. If you set the `routing_preference` to either `TRAFFIC_AWARE` or `TRAFFIC_AWARE_OPTIMAL`, then this value is calculated taking traffic conditions into account.
.google.protobuf.Duration duration = 3;com.google.protobuf.DurationOrBuilder getDurationOrBuilder()
The length of time needed to navigate the route. If you set the `routing_preference` to `TRAFFIC_UNAWARE`, then this value is the same as `static_duration`. If you set the `routing_preference` to either `TRAFFIC_AWARE` or `TRAFFIC_AWARE_OPTIMAL`, then this value is calculated taking traffic conditions into account.
.google.protobuf.Duration duration = 3;boolean hasStaticDuration()
The duration of travel through the route without taking traffic conditions into consideration.
.google.protobuf.Duration static_duration = 4;com.google.protobuf.Duration getStaticDuration()
The duration of travel through the route without taking traffic conditions into consideration.
.google.protobuf.Duration static_duration = 4;com.google.protobuf.DurationOrBuilder getStaticDurationOrBuilder()
The duration of travel through the route without taking traffic conditions into consideration.
.google.protobuf.Duration static_duration = 4;boolean hasPolyline()
The overall route polyline. This polyline is the combined polyline of all `legs`.
.google.maps.routing.v2.Polyline polyline = 5;Polyline getPolyline()
The overall route polyline. This polyline is the combined polyline of all `legs`.
.google.maps.routing.v2.Polyline polyline = 5;PolylineOrBuilder getPolylineOrBuilder()
The overall route polyline. This polyline is the combined polyline of all `legs`.
.google.maps.routing.v2.Polyline polyline = 5;String getDescription()
A description of the route.
string description = 6;com.google.protobuf.ByteString getDescriptionBytes()
A description of the route.
string description = 6;List<String> getWarningsList()
An array of warnings to show when displaying the route.
repeated string warnings = 7;int getWarningsCount()
An array of warnings to show when displaying the route.
repeated string warnings = 7;String getWarnings(int index)
An array of warnings to show when displaying the route.
repeated string warnings = 7;index - The index of the element to return.com.google.protobuf.ByteString getWarningsBytes(int index)
An array of warnings to show when displaying the route.
repeated string warnings = 7;index - The index of the value to return.boolean hasViewport()
The viewport bounding box of the polyline.
.google.geo.type.Viewport viewport = 8;com.google.geo.type.Viewport getViewport()
The viewport bounding box of the polyline.
.google.geo.type.Viewport viewport = 8;com.google.geo.type.ViewportOrBuilder getViewportOrBuilder()
The viewport bounding box of the polyline.
.google.geo.type.Viewport viewport = 8;boolean hasTravelAdvisory()
Additional information about the route.
.google.maps.routing.v2.RouteTravelAdvisory travel_advisory = 9;RouteTravelAdvisory getTravelAdvisory()
Additional information about the route.
.google.maps.routing.v2.RouteTravelAdvisory travel_advisory = 9;RouteTravelAdvisoryOrBuilder getTravelAdvisoryOrBuilder()
Additional information about the route.
.google.maps.routing.v2.RouteTravelAdvisory travel_advisory = 9;List<Integer> getOptimizedIntermediateWaypointIndexList()
If you set [`optimize_waypoint_order`][google.maps.routing.v2.ComputeRoutesRequest.optimize_waypoint_order] to true, this field contains the optimized ordering of intermediate waypoints. Otherwise, this field is empty. For example, if you give an input of Origin: LA; Intermediate waypoints: Dallas, Bangor, Phoenix; Destination: New York; and the optimized intermediate waypoint order is Phoenix, Dallas, Bangor, then this field contains the values [2, 0, 1]. The index starts with 0 for the first intermediate waypoint provided in the input.
repeated int32 optimized_intermediate_waypoint_index = 10;int getOptimizedIntermediateWaypointIndexCount()
If you set [`optimize_waypoint_order`][google.maps.routing.v2.ComputeRoutesRequest.optimize_waypoint_order] to true, this field contains the optimized ordering of intermediate waypoints. Otherwise, this field is empty. For example, if you give an input of Origin: LA; Intermediate waypoints: Dallas, Bangor, Phoenix; Destination: New York; and the optimized intermediate waypoint order is Phoenix, Dallas, Bangor, then this field contains the values [2, 0, 1]. The index starts with 0 for the first intermediate waypoint provided in the input.
repeated int32 optimized_intermediate_waypoint_index = 10;int getOptimizedIntermediateWaypointIndex(int index)
If you set [`optimize_waypoint_order`][google.maps.routing.v2.ComputeRoutesRequest.optimize_waypoint_order] to true, this field contains the optimized ordering of intermediate waypoints. Otherwise, this field is empty. For example, if you give an input of Origin: LA; Intermediate waypoints: Dallas, Bangor, Phoenix; Destination: New York; and the optimized intermediate waypoint order is Phoenix, Dallas, Bangor, then this field contains the values [2, 0, 1]. The index starts with 0 for the first intermediate waypoint provided in the input.
repeated int32 optimized_intermediate_waypoint_index = 10;index - The index of the element to return.boolean hasLocalizedValues()
Text representations of properties of the `Route`.
.google.maps.routing.v2.Route.RouteLocalizedValues localized_values = 11;Route.RouteLocalizedValues getLocalizedValues()
Text representations of properties of the `Route`.
.google.maps.routing.v2.Route.RouteLocalizedValues localized_values = 11;Route.RouteLocalizedValuesOrBuilder getLocalizedValuesOrBuilder()
Text representations of properties of the `Route`.
.google.maps.routing.v2.Route.RouteLocalizedValues localized_values = 11;String getRouteToken()
An opaque token that can be passed to [Navigation SDK](https://developers.google.com/maps/documentation/navigation) to reconstruct the route during navigation, and, in the event of rerouting, honor the original intention when the route was created. Treat this token as an opaque blob. Don't compare its value across requests as its value may change even if the service returns the exact same route. NOTE: `Route.route_token` is only available for requests that have set `ComputeRoutesRequest.routing_preference` to `TRAFFIC_AWARE` or `TRAFFIC_AWARE_OPTIMAL`. `Route.route_token` is not supported for requests that have Via waypoints.
string route_token = 12;com.google.protobuf.ByteString getRouteTokenBytes()
An opaque token that can be passed to [Navigation SDK](https://developers.google.com/maps/documentation/navigation) to reconstruct the route during navigation, and, in the event of rerouting, honor the original intention when the route was created. Treat this token as an opaque blob. Don't compare its value across requests as its value may change even if the service returns the exact same route. NOTE: `Route.route_token` is only available for requests that have set `ComputeRoutesRequest.routing_preference` to `TRAFFIC_AWARE` or `TRAFFIC_AWARE_OPTIMAL`. `Route.route_token` is not supported for requests that have Via waypoints.
string route_token = 12;boolean hasPolylineDetails()
Contains information about details along the polyline.
.google.maps.routing.v2.PolylineDetails polyline_details = 14;PolylineDetails getPolylineDetails()
Contains information about details along the polyline.
.google.maps.routing.v2.PolylineDetails polyline_details = 14;PolylineDetailsOrBuilder getPolylineDetailsOrBuilder()
Contains information about details along the polyline.
.google.maps.routing.v2.PolylineDetails polyline_details = 14;Copyright © 2025 Google LLC. All rights reserved.