1// Copyright 2023 Google LLC 2// 3// Licensed under the Apache License, Version 2.0 (the "License"); 4// you may not use this file except in compliance with the License. 5// You may obtain a copy of the License at 6// 7// http://www.apache.org/licenses/LICENSE-2.0 8// 9// Unless required by applicable law or agreed to in writing, software 10// distributed under the License is distributed on an "AS IS" BASIS, 11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12// See the License for the specific language governing permissions and 13// limitations under the License. 14 15syntax = "proto3"; 16 17package google.maps.routing.v2; 18 19import "google/geo/type/viewport.proto"; 20import "google/maps/routing/v2/localized_time.proto"; 21import "google/maps/routing/v2/location.proto"; 22import "google/maps/routing/v2/navigation_instruction.proto"; 23import "google/maps/routing/v2/polyline.proto"; 24import "google/maps/routing/v2/route_label.proto"; 25import "google/maps/routing/v2/route_travel_mode.proto"; 26import "google/maps/routing/v2/speed_reading_interval.proto"; 27import "google/maps/routing/v2/toll_info.proto"; 28import "google/maps/routing/v2/transit.proto"; 29import "google/protobuf/duration.proto"; 30import "google/protobuf/timestamp.proto"; 31import "google/type/localized_text.proto"; 32import "google/type/money.proto"; 33 34option cc_enable_arenas = true; 35option csharp_namespace = "Google.Maps.Routing.V2"; 36option go_package = "cloud.google.com/go/maps/routing/apiv2/routingpb;routingpb"; 37option java_multiple_files = true; 38option java_outer_classname = "RouteProto"; 39option java_package = "com.google.maps.routing.v2"; 40option objc_class_prefix = "GMRV2"; 41option php_namespace = "Google\\Maps\\Routing\\V2"; 42option ruby_package = "Google::Maps::Routing::V2"; 43 44// Contains a route, which consists of a series of connected road segments 45// that join beginning, ending, and intermediate waypoints. 46message Route { 47 // Text representations of certain properties. 48 message RouteLocalizedValues { 49 // Travel distance represented in text form. 50 google.type.LocalizedText distance = 1; 51 52 // Duration taking traffic conditions into consideration, represented in 53 // text form. Note: If you did not request traffic information, this value 54 // will be the same value as `static_duration`. 55 google.type.LocalizedText duration = 2; 56 57 // Duration without taking traffic conditions into consideration, 58 // represented in text form. 59 google.type.LocalizedText static_duration = 3; 60 61 // Transit fare represented in text form. 62 google.type.LocalizedText transit_fare = 4; 63 } 64 65 // Labels for the `Route` that are useful to identify specific properties 66 // of the route to compare against others. 67 repeated RouteLabel route_labels = 13; 68 69 // A collection of legs (path segments between waypoints) that make up the 70 // route. Each leg corresponds to the trip between two non-`via` 71 // [`Waypoints`][google.maps.routing.v2.Waypoint]. For example, a route with 72 // no intermediate waypoints has only one leg. A route that includes one 73 // non-`via` intermediate waypoint has two legs. A route that includes one 74 // `via` intermediate waypoint has one leg. The order of the legs matches the 75 // order of waypoints from `origin` to `intermediates` to `destination`. 76 repeated RouteLeg legs = 1; 77 78 // The travel distance of the route, in meters. 79 int32 distance_meters = 2; 80 81 // The length of time needed to navigate the route. If you set the 82 // `routing_preference` to `TRAFFIC_UNAWARE`, then this value is the same as 83 // `static_duration`. If you set the `routing_preference` to either 84 // `TRAFFIC_AWARE` or `TRAFFIC_AWARE_OPTIMAL`, then this value is calculated 85 // taking traffic conditions into account. 86 google.protobuf.Duration duration = 3; 87 88 // The duration of travel through the route without taking traffic 89 // conditions into consideration. 90 google.protobuf.Duration static_duration = 4; 91 92 // The overall route polyline. This polyline is the combined polyline of 93 // all `legs`. 94 Polyline polyline = 5; 95 96 // A description of the route. 97 string description = 6; 98 99 // An array of warnings to show when displaying the route. 100 repeated string warnings = 7; 101 102 // The viewport bounding box of the polyline. 103 google.geo.type.Viewport viewport = 8; 104 105 // Additional information about the route. 106 RouteTravelAdvisory travel_advisory = 9; 107 108 // If you set 109 // [`optimize_waypoint_order`][google.maps.routing.v2.ComputeRoutesRequest.optimize_waypoint_order] 110 // to true, this field contains the optimized ordering of intermediate 111 // waypoints. Otherwise, this field is empty. 112 // For example, if you give an input of Origin: LA; Intermediate waypoints: 113 // Dallas, Bangor, Phoenix; Destination: New York; and the optimized 114 // intermediate waypoint order is Phoenix, Dallas, Bangor, then this field 115 // contains the values [2, 0, 1]. The index starts with 0 for the first 116 // intermediate waypoint provided in the input. 117 repeated int32 optimized_intermediate_waypoint_index = 10; 118 119 // Text representations of properties of the `Route`. 120 RouteLocalizedValues localized_values = 11; 121 122 // A web-safe, base64-encoded route token that can be passed to the Navigation 123 // SDK, that allows the Navigation SDK to reconstruct the route during 124 // navigation, and, in the event of rerouting, honor the original intention 125 // when you created the route by calling ComputeRoutes. Customers should treat 126 // this token as an opaque blob. It is not meant for reading or mutating. 127 // NOTE: `Route.route_token` is only available for requests that have set 128 // `ComputeRoutesRequest.routing_preference` to `TRAFFIC_AWARE` or 129 // `TRAFFIC_AWARE_OPTIMAL`. `Route.route_token` is not supported for requests 130 // that have Via waypoints. 131 string route_token = 12; 132} 133 134// Contains the additional information that the user should be informed 135// about, such as possible traffic zone restrictions. 136message RouteTravelAdvisory { 137 // Contains information about tolls on the route. This field is only populated 138 // if tolls are expected on the route. If this field is set, but the 139 // `estimatedPrice` subfield is not populated, then the route contains tolls, 140 // but the estimated price is unknown. If this field is not set, then there 141 // are no tolls expected on the route. 142 TollInfo toll_info = 2; 143 144 // Speed reading intervals detailing traffic density. Applicable in case of 145 // `TRAFFIC_AWARE` and `TRAFFIC_AWARE_OPTIMAL` routing preferences. 146 // The intervals cover the entire polyline of the route without overlap. 147 // The start point of a specified interval is the same as the end point of the 148 // preceding interval. 149 // 150 // Example: 151 // 152 // polyline: A ---- B ---- C ---- D ---- E ---- F ---- G 153 // speed_reading_intervals: [A,C), [C,D), [D,G). 154 repeated SpeedReadingInterval speed_reading_intervals = 3; 155 156 // The predicted fuel consumption in microliters. 157 int64 fuel_consumption_microliters = 5; 158 159 // Returned route may have restrictions that are not suitable for requested 160 // travel mode or route modifiers. 161 bool route_restrictions_partially_ignored = 6; 162 163 // If present, contains the total fare or ticket costs on this route 164 // This property is only returned for `TRANSIT` requests and only 165 // for routes where fare information is available for all transit steps. 166 google.type.Money transit_fare = 7; 167} 168 169// Contains the additional information that the user should be informed 170// about on a leg step, such as possible traffic zone restrictions. 171message RouteLegTravelAdvisory { 172 // Contains information about tolls on the specific `RouteLeg`. 173 // This field is only populated if we expect there are tolls on the 174 // `RouteLeg`. If this field is set but the estimated_price subfield is not 175 // populated, we expect that road contains tolls but we do not know an 176 // estimated price. If this field does not exist, then there is no toll on the 177 // `RouteLeg`. 178 TollInfo toll_info = 1; 179 180 // Speed reading intervals detailing traffic density. Applicable in case of 181 // `TRAFFIC_AWARE` and `TRAFFIC_AWARE_OPTIMAL` routing preferences. 182 // The intervals cover the entire polyline of the `RouteLeg` without overlap. 183 // The start point of a specified interval is the same as the end point of the 184 // preceding interval. 185 // 186 // Example: 187 // 188 // polyline: A ---- B ---- C ---- D ---- E ---- F ---- G 189 // speed_reading_intervals: [A,C), [C,D), [D,G). 190 repeated SpeedReadingInterval speed_reading_intervals = 2; 191} 192 193// Contains the additional information that the user should be informed 194// about, such as possible traffic zone restrictions on a leg step. 195message RouteLegStepTravelAdvisory { 196 // NOTE: This field is not currently populated. 197 repeated SpeedReadingInterval speed_reading_intervals = 1; 198} 199 200// Contains a segment between non-`via` waypoints. 201message RouteLeg { 202 // Text representations of certain properties. 203 message RouteLegLocalizedValues { 204 // Travel distance represented in text form. 205 google.type.LocalizedText distance = 1; 206 207 // Duration taking traffic conditions into consideration represented in text 208 // form. Note: If you did not request traffic information, this value will 209 // be the same value as static_duration. 210 google.type.LocalizedText duration = 2; 211 212 // Duration without taking traffic conditions into 213 // consideration, represented in text form. 214 google.type.LocalizedText static_duration = 3; 215 } 216 217 // Provides overview information about a list of `RouteLegStep`s. 218 message StepsOverview { 219 // Provides summarized information about different multi-modal segments of 220 // the `RouteLeg.steps`. A multi-modal segment is defined as one or more 221 // contiguous `RouteLegStep` that have the same `RouteTravelMode`. 222 // This field is not populated if the `RouteLeg` does not contain any 223 // multi-modal segments in the steps. 224 message MultiModalSegment { 225 // The corresponding `RouteLegStep` index that is the start of a 226 // multi-modal segment. 227 optional int32 step_start_index = 1; 228 229 // The corresponding `RouteLegStep` index that is the end of a 230 // multi-modal segment. 231 optional int32 step_end_index = 2; 232 233 // NavigationInstruction for the multi-modal segment. 234 NavigationInstruction navigation_instruction = 3; 235 236 // The travel mode of the multi-modal segment. 237 RouteTravelMode travel_mode = 4; 238 } 239 240 // Summarized information about different multi-modal segments of 241 // the `RouteLeg.steps`. This field is not populated if the `RouteLeg` does 242 // not contain any multi-modal segments in the steps. 243 repeated MultiModalSegment multi_modal_segments = 1; 244 } 245 246 // The travel distance of the route leg, in meters. 247 int32 distance_meters = 1; 248 249 // The length of time needed to navigate the leg. If the `route_preference` 250 // is set to `TRAFFIC_UNAWARE`, then this value is the same as 251 // `static_duration`. If the `route_preference` is either `TRAFFIC_AWARE` or 252 // `TRAFFIC_AWARE_OPTIMAL`, then this value is calculated taking traffic 253 // conditions into account. 254 google.protobuf.Duration duration = 2; 255 256 // The duration of travel through the leg, calculated without taking 257 // traffic conditions into consideration. 258 google.protobuf.Duration static_duration = 3; 259 260 // The overall polyline for this leg that includes each `step`'s 261 // polyline. 262 Polyline polyline = 4; 263 264 // The start location of this leg. This location might be different from the 265 // provided `origin`. For example, when the provided `origin` is not near a 266 // road, this is a point on the road. 267 Location start_location = 5; 268 269 // The end location of this leg. This location might be different from the 270 // provided `destination`. For example, when the provided `destination` is not 271 // near a road, this is a point on the road. 272 Location end_location = 6; 273 274 // An array of steps denoting segments within this leg. Each step represents 275 // one navigation instruction. 276 repeated RouteLegStep steps = 7; 277 278 // Contains the additional information that the user should be informed 279 // about, such as possible traffic zone restrictions, on a route leg. 280 RouteLegTravelAdvisory travel_advisory = 8; 281 282 // Text representations of properties of the `RouteLeg`. 283 RouteLegLocalizedValues localized_values = 9; 284 285 // Overview information about the steps in this `RouteLeg`. This field is only 286 // populated for TRANSIT routes. 287 StepsOverview steps_overview = 10; 288} 289 290// Contains a segment of a [`RouteLeg`][google.maps.routing.v2.RouteLeg]. A 291// step corresponds to a single navigation instruction. Route legs are made up 292// of steps. 293message RouteLegStep { 294 // Text representations of certain properties. 295 message RouteLegStepLocalizedValues { 296 // Travel distance represented in text form. 297 google.type.LocalizedText distance = 1; 298 299 // Duration without taking traffic conditions into 300 // consideration, represented in text form. 301 google.type.LocalizedText static_duration = 3; 302 } 303 304 // The travel distance of this step, in meters. In some circumstances, this 305 // field might not have a value. 306 int32 distance_meters = 1; 307 308 // The duration of travel through this step without taking traffic conditions 309 // into consideration. In some circumstances, this field might not have a 310 // value. 311 google.protobuf.Duration static_duration = 2; 312 313 // The polyline associated with this step. 314 Polyline polyline = 3; 315 316 // The start location of this step. 317 Location start_location = 4; 318 319 // The end location of this step. 320 Location end_location = 5; 321 322 // Navigation instructions. 323 NavigationInstruction navigation_instruction = 6; 324 325 // Contains the additional information that the user should be informed 326 // about, such as possible traffic zone restrictions, on a leg step. 327 RouteLegStepTravelAdvisory travel_advisory = 7; 328 329 // Text representations of properties of the `RouteLegStep`. 330 RouteLegStepLocalizedValues localized_values = 8; 331 332 // Details pertaining to this step if the travel mode is `TRANSIT`. 333 RouteLegStepTransitDetails transit_details = 9; 334 335 // The travel mode used for this step. 336 RouteTravelMode travel_mode = 10; 337} 338 339// Additional information for the `RouteLegStep` related to `TRANSIT` routes. 340message RouteLegStepTransitDetails { 341 // Details about the transit stops for the `RouteLegStep`. 342 message TransitStopDetails { 343 // Information about the arrival stop for the step. 344 TransitStop arrival_stop = 1; 345 346 // The estimated time of arrival for the step. 347 google.protobuf.Timestamp arrival_time = 2; 348 349 // Information about the departure stop for the step. 350 TransitStop departure_stop = 3; 351 352 // The estimated time of departure for the step. 353 google.protobuf.Timestamp departure_time = 4; 354 } 355 356 // Localized descriptions of values for `RouteTransitDetails`. 357 message TransitDetailsLocalizedValues { 358 // Time in its formatted text representation with a corresponding time zone. 359 LocalizedTime arrival_time = 1; 360 361 // Time in its formatted text representation with a corresponding time zone. 362 LocalizedTime departure_time = 2; 363 } 364 365 // Information about the arrival and departure stops for the step. 366 TransitStopDetails stop_details = 1; 367 368 // Text representations of properties of the `RouteLegStepTransitDetails`. 369 TransitDetailsLocalizedValues localized_values = 2; 370 371 // Specifies the direction in which to travel on this line as marked on 372 // the vehicle or at the departure stop. The direction is often the terminus 373 // station. 374 string headsign = 3; 375 376 // Specifies the expected time as a duration between departures from the same 377 // stop at this time. For example, with a headway seconds value of 600, you 378 // would expect a ten minute wait if you should miss your bus. 379 google.protobuf.Duration headway = 4; 380 381 // Information about the transit line used in this step. 382 TransitLine transit_line = 5; 383 384 // The number of stops from the departure to the arrival stop. This count 385 // includes the arrival stop, but excludes the departure stop. For example, if 386 // your route leaves from Stop A, passes through stops B and C, and arrives at 387 // stop D, stop_count will return 3. 388 int32 stop_count = 6; 389 390 // The text that appears in schedules and sign boards to identify a transit 391 // trip to passengers. The text should uniquely identify a trip within a 392 // service day. For example, "538" is the `trip_short_text` of the Amtrak 393 // train that leaves San Jose, CA at 15:10 on weekdays to Sacramento, CA. 394 string trip_short_text = 7; 395} 396