Show / Hide Table of Contents

Class ComputeRoutesRequest

ComputeRoutes request message.

Inheritance
object
ComputeRoutesRequest
Implements
IMessage<ComputeRoutesRequest>
IEquatable<ComputeRoutesRequest>
IDeepCloneable<ComputeRoutesRequest>
IBufferMessage
IMessage
Inherited Members
object.GetHashCode()
object.GetType()
object.ToString()
Namespace: Google.Maps.Routing.V2
Assembly: Google.Maps.Routing.V2.dll
Syntax
public sealed class ComputeRoutesRequest : IMessage<ComputeRoutesRequest>, IEquatable<ComputeRoutesRequest>, IDeepCloneable<ComputeRoutesRequest>, IBufferMessage, IMessage

Constructors

ComputeRoutesRequest()

Declaration
public ComputeRoutesRequest()

ComputeRoutesRequest(ComputeRoutesRequest)

Declaration
public ComputeRoutesRequest(ComputeRoutesRequest other)
Parameters
Type Name Description
ComputeRoutesRequest other

Properties

ArrivalTime

Optional. The arrival time. NOTE: Can only be set when [RouteTravelMode][google.maps.routing.v2.RouteTravelMode] is set to TRANSIT. You can specify either departure_time or arrival_time, but not both. Transit trips are available for up to 7 days in the past or 100 days in the future.

Declaration
public Timestamp ArrivalTime { get; set; }
Property Value
Type Description
Timestamp

ComputeAlternativeRoutes

Optional. Specifies whether to calculate alternate routes in addition to the route. No alternative routes are returned for requests that have intermediate waypoints.

Declaration
public bool ComputeAlternativeRoutes { get; set; }
Property Value
Type Description
bool

DepartureTime

Optional. The departure time. If you don't set this value, then this value defaults to the time that you made the request. NOTE: You can only specify a departure_time in the past when [RouteTravelMode][google.maps.routing.v2.RouteTravelMode] is set to TRANSIT. Transit trips are available for up to 7 days in the past or 100 days in the future.

Declaration
public Timestamp DepartureTime { get; set; }
Property Value
Type Description
Timestamp

Destination

Required. Destination waypoint.

Declaration
public Waypoint Destination { get; set; }
Property Value
Type Description
Waypoint

ExtraComputations

Optional. A list of extra computations which may be used to complete the request. Note: These extra computations may return extra fields on the response. These extra fields must also be specified in the field mask to be returned in the response.

Declaration
public RepeatedField<ComputeRoutesRequest.Types.ExtraComputation> ExtraComputations { get; }
Property Value
Type Description
RepeatedField<ComputeRoutesRequest.Types.ExtraComputation>

Intermediates

Optional. A set of waypoints along the route (excluding terminal points), for either stopping at or passing by. Up to 25 intermediate waypoints are supported.

Declaration
public RepeatedField<Waypoint> Intermediates { get; }
Property Value
Type Description
RepeatedField<Waypoint>

LanguageCode

Optional. The BCP-47 language code, such as "en-US" or "sr-Latn". For more information, see Unicode Locale Identifier. See Language Support for the list of supported languages. When you don't provide this value, the display language is inferred from the location of the route request.

Declaration
public string LanguageCode { get; set; }
Property Value
Type Description
string

OptimizeWaypointOrder

Optional. If set to true, the service attempts to minimize the overall cost of the route by re-ordering the specified intermediate waypoints. The request fails if any of the intermediate waypoints is a via waypoint. Use ComputeRoutesResponse.Routes.optimized_intermediate_waypoint_index to find the new ordering. If ComputeRoutesResponseroutes.optimized_intermediate_waypoint_index is not requested in the X-Goog-FieldMask header, the request fails. If optimize_waypoint_order is set to false, ComputeRoutesResponse.optimized_intermediate_waypoint_index will be empty.

Declaration
public bool OptimizeWaypointOrder { get; set; }
Property Value
Type Description
bool

Origin

Required. Origin waypoint.

Declaration
public Waypoint Origin { get; set; }
Property Value
Type Description
Waypoint

PolylineEncoding

Optional. Specifies the preferred encoding for the polyline.

Declaration
public PolylineEncoding PolylineEncoding { get; set; }
Property Value
Type Description
PolylineEncoding

PolylineQuality

Optional. Specifies your preference for the quality of the polyline.

Declaration
public PolylineQuality PolylineQuality { get; set; }
Property Value
Type Description
PolylineQuality

RegionCode

Optional. The region code, specified as a ccTLD ("top-level domain") two-character value. For more information see Country code top-level domains.

Declaration
public string RegionCode { get; set; }
Property Value
Type Description
string

RequestedReferenceRoutes

Optional. Specifies what reference routes to calculate as part of the request in addition to the default route. A reference route is a route with a different route calculation objective than the default route. For example a FUEL_EFFICIENT reference route calculation takes into account various parameters that would generate an optimal fuel efficient route. When using this feature, look for [route_labels][google.maps.routing.v2.Route.route_labels] on the resulting routes.

Declaration
public RepeatedField<ComputeRoutesRequest.Types.ReferenceRoute> RequestedReferenceRoutes { get; }
Property Value
Type Description
RepeatedField<ComputeRoutesRequest.Types.ReferenceRoute>

RouteModifiers

Optional. A set of conditions to satisfy that affect the way routes are calculated.

Declaration
public RouteModifiers RouteModifiers { get; set; }
Property Value
Type Description
RouteModifiers

RoutingPreference

Optional. Specifies how to compute the route. The server attempts to use the selected routing preference to compute the route. If the routing preference results in an error or an extra long latency, then an error is returned. You can specify this option only when the travel_mode is DRIVE or TWO_WHEELER, otherwise the request fails.

Declaration
public RoutingPreference RoutingPreference { get; set; }
Property Value
Type Description
RoutingPreference

TrafficModel

Optional. Specifies the assumptions to use when calculating time in traffic. This setting affects the value returned in the duration field in the [Route][google.maps.routing.v2.Route] and [RouteLeg][google.maps.routing.v2.RouteLeg] which contains the predicted time in traffic based on historical averages. TrafficModel is only available for requests that have set [RoutingPreference][google.maps.routing.v2.RoutingPreference] to TRAFFIC_AWARE_OPTIMAL and [RouteTravelMode][google.maps.routing.v2.RouteTravelMode] to DRIVE. Defaults to BEST_GUESS if traffic is requested and TrafficModel is not specified.

Declaration
public TrafficModel TrafficModel { get; set; }
Property Value
Type Description
TrafficModel

TransitPreferences

Optional. Specifies preferences that influence the route returned for TRANSIT routes. NOTE: You can only specify a transit_preferences when [RouteTravelMode][google.maps.routing.v2.RouteTravelMode] is set to TRANSIT.

Declaration
public TransitPreferences TransitPreferences { get; set; }
Property Value
Type Description
TransitPreferences

TravelMode

Optional. Specifies the mode of transportation.

Declaration
public RouteTravelMode TravelMode { get; set; }
Property Value
Type Description
RouteTravelMode

Units

Optional. Specifies the units of measure for the display fields. These fields include the instruction field in [NavigationInstruction][google.maps.routing.v2.NavigationInstruction]. The units of measure used for the route, leg, step distance, and duration are not affected by this value. If you don't provide this value, then the display units are inferred from the location of the first origin.

Declaration
public Units Units { get; set; }
Property Value
Type Description
Units
In this article
Back to top Generated by DocFX