@googlemaps/routing 0.5.1 → 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -26,11 +26,14 @@ import "google/maps/routing/v2/route.proto";
26
26
  import "google/maps/routing/v2/route_modifiers.proto";
27
27
  import "google/maps/routing/v2/route_travel_mode.proto";
28
28
  import "google/maps/routing/v2/routing_preference.proto";
29
+ import "google/maps/routing/v2/traffic_model.proto";
30
+ import "google/maps/routing/v2/transit_preferences.proto";
29
31
  import "google/maps/routing/v2/units.proto";
30
32
  import "google/maps/routing/v2/waypoint.proto";
31
33
  import "google/protobuf/duration.proto";
32
34
  import "google/protobuf/timestamp.proto";
33
35
  import "google/rpc/status.proto";
36
+ import "google/type/localized_text.proto";
34
37
 
35
38
  option cc_enable_arenas = true;
36
39
  option csharp_namespace = "Google.Maps.Routing.V2";
@@ -157,6 +160,13 @@ message ComputeRoutesRequest {
157
160
 
158
161
  // Traffic aware polylines for the route(s).
159
162
  TRAFFIC_ON_POLYLINE = 3;
163
+
164
+ // [Navigation
165
+ // Instructions][google.maps.routing.v2.NavigationInstructions.instructions]
166
+ // presented as a formatted HTML text string. This content
167
+ // is meant to be read as-is. This content is for display only.
168
+ // Do not programmatically parse it.
169
+ HTML_FORMATTED_NAVIGATION_INSTRUCTIONS = 4;
160
170
  }
161
171
 
162
172
  // Required. Origin waypoint.
@@ -189,11 +199,21 @@ message ComputeRoutesRequest {
189
199
  [(google.api.field_behavior) = OPTIONAL];
190
200
 
191
201
  // Optional. The departure time. If you don't set this value, then this value
192
- // defaults to the time that you made the request. If you set this value to a
193
- // time that has already occurred, then the request fails.
202
+ // defaults to the time that you made the request.
203
+ // NOTE: You can only specify a `departure_time` in the past when
204
+ // [RouteTravelMode][google.maps.routing.v2.RouteTravelMode] is set to
205
+ // `TRANSIT`.
194
206
  google.protobuf.Timestamp departure_time = 7
195
207
  [(google.api.field_behavior) = OPTIONAL];
196
208
 
209
+ // Optional. The arrival time.
210
+ // NOTE: Can only be set when
211
+ // [RouteTravelMode][google.maps.routing.v2.RouteTravelMode] is set to
212
+ // `TRANSIT`. You can specify either departure_time or arrival_time, but not
213
+ // both.
214
+ google.protobuf.Timestamp arrival_time = 19
215
+ [(google.api.field_behavior) = OPTIONAL];
216
+
197
217
  // Optional. Specifies whether to calculate alternate routes in addition to
198
218
  // the route. No alternative routes are returned for requests that have
199
219
  // intermediate waypoints.
@@ -216,14 +236,26 @@ message ComputeRoutesRequest {
216
236
  // https://en.wikipedia.org/wiki/List_of_Internet_top-level_domains#Country_code_top-level_domains
217
237
  string region_code = 16 [(google.api.field_behavior) = OPTIONAL];
218
238
 
219
- // Optional. Specifies the units of measure for the display fields. This
220
- // includes the `instruction` field in
239
+ // Optional. Specifies the units of measure for the display fields. These
240
+ // fields include the `instruction` field in
221
241
  // [NavigationInstruction][google.maps.routing.v2.NavigationInstruction]. The
222
242
  // units of measure used for the route, leg, step distance, and duration are
223
243
  // not affected by this value. If you don't provide this value, then the
224
- // display units are inferred from the location of the request.
244
+ // display units are inferred from the location of the first origin.
225
245
  Units units = 11 [(google.api.field_behavior) = OPTIONAL];
226
246
 
247
+ // Optional. If set to true, the service attempts to minimize the overall cost
248
+ // of the route by re-ordering the specified intermediate waypoints. The
249
+ // request fails if any of the intermediate waypoints is a `via` waypoint. Use
250
+ // `ComputeRoutesResponse.Routes.optimized_intermediate_waypoint_index` to
251
+ // find the new ordering.
252
+ // If `ComputeRoutesResponseroutes.optimized_intermediate_waypoint_index` is
253
+ // not requested in the `X-Goog-FieldMask` header, the request fails.
254
+ // If `optimize_waypoint_order` is set to false,
255
+ // `ComputeRoutesResponse.optimized_intermediate_waypoint_index` will be
256
+ // empty.
257
+ bool optimize_waypoint_order = 13 [(google.api.field_behavior) = OPTIONAL];
258
+
227
259
  // Optional. Specifies what reference routes to calculate as part of the
228
260
  // request in addition to the default route. A reference route is a route with
229
261
  // a different route calculation objective than the default route. For example
@@ -238,6 +270,26 @@ message ComputeRoutesRequest {
238
270
  // returned in the response.
239
271
  repeated ExtraComputation extra_computations = 15
240
272
  [(google.api.field_behavior) = OPTIONAL];
273
+
274
+ // Optional. Specifies the assumptions to use when calculating time in
275
+ // traffic. This setting affects the value returned in the duration field in
276
+ // the [Route][google.maps.routing.v2.Route] and
277
+ // [RouteLeg][google.maps.routing.v2.RouteLeg] which contains the predicted
278
+ // time in traffic based on historical averages.
279
+ // `TrafficModel` is only available for requests that have set
280
+ // [RoutingPreference][google.maps.routing.v2.RoutingPreference] to
281
+ // `TRAFFIC_AWARE_OPTIMAL` and
282
+ // [RouteTravelMode][google.maps.routing.v2.RouteTravelMode] to `DRIVE`.
283
+ // Defaults to `BEST_GUESS` if traffic is requested and `TrafficModel` is not
284
+ // specified.
285
+ TrafficModel traffic_model = 18 [(google.api.field_behavior) = OPTIONAL];
286
+
287
+ // Optional. Specifies preferences that influence the route returned for
288
+ // `TRANSIT` routes. NOTE: You can only specify a `transit_preferences` when
289
+ // [RouteTravelMode][google.maps.routing.v2.RouteTravelMode] is set to
290
+ // `TRANSIT`.
291
+ TransitPreferences transit_preferences = 20
292
+ [(google.api.field_behavior) = OPTIONAL];
241
293
  }
242
294
 
243
295
  // ComputeRoutes the response message.
@@ -299,12 +351,22 @@ message ComputeRouteMatrixRequest {
299
351
  RoutingPreference routing_preference = 4
300
352
  [(google.api.field_behavior) = OPTIONAL];
301
353
 
302
- // Optional. The departure time. If you don't set this value, this defaults to
303
- // the time that you made the request. If you set this value to a time that
304
- // has already occurred, the request fails.
354
+ // Optional. The departure time. If you don't set this value, then this value
355
+ // defaults to the time that you made the request.
356
+ // NOTE: You can only specify a `departure_time` in the past when
357
+ // [RouteTravelMode][google.maps.routing.v2.RouteTravelMode] is set to
358
+ // `TRANSIT`.
305
359
  google.protobuf.Timestamp departure_time = 5
306
360
  [(google.api.field_behavior) = OPTIONAL];
307
361
 
362
+ // Optional. The arrival time.
363
+ // NOTE: Can only be set when
364
+ // [RouteTravelMode][google.maps.routing.v2.RouteTravelMode] is set to
365
+ // `TRANSIT`. You can specify either departure_time or arrival_time, but not
366
+ // both.
367
+ google.protobuf.Timestamp arrival_time = 11
368
+ [(google.api.field_behavior) = OPTIONAL];
369
+
308
370
  // Optional. The BCP-47 language code, such as "en-US" or "sr-Latn". For more
309
371
  // information, see
310
372
  // http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. See
@@ -324,6 +386,24 @@ message ComputeRouteMatrixRequest {
324
386
  // returned in the response.
325
387
  repeated ExtraComputation extra_computations = 8
326
388
  [(google.api.field_behavior) = OPTIONAL];
389
+
390
+ // Optional. Specifies the assumptions to use when calculating time in
391
+ // traffic. This setting affects the value returned in the duration field in
392
+ // the [RouteMatrixElement][google.maps.routing.v2.RouteMatrixElement] which
393
+ // contains the predicted time in traffic based on historical averages.
394
+ // [RoutingPreference][google.maps.routing.v2.RoutingPreference] to
395
+ // `TRAFFIC_AWARE_OPTIMAL` and
396
+ // [RouteTravelMode][google.maps.routing.v2.RouteTravelMode] to `DRIVE`.
397
+ // Defaults to `BEST_GUESS` if traffic is requested and `TrafficModel` is not
398
+ // specified.
399
+ TrafficModel traffic_model = 10 [(google.api.field_behavior) = OPTIONAL];
400
+
401
+ // Optional. Specifies preferences that influence the route returned for
402
+ // `TRANSIT` routes. NOTE: You can only specify a `transit_preferences` when
403
+ // [RouteTravelMode][google.maps.routing.v2.RouteTravelMode] is set to
404
+ // `TRANSIT`.
405
+ TransitPreferences transit_preferences = 12
406
+ [(google.api.field_behavior) = OPTIONAL];
327
407
  }
328
408
 
329
409
  // A single origin for ComputeRouteMatrixRequest
@@ -341,9 +421,27 @@ message RouteMatrixDestination {
341
421
  Waypoint waypoint = 1 [(google.api.field_behavior) = REQUIRED];
342
422
  }
343
423
 
344
- // Encapsulates route information computed for an origin/destination pair in the
424
+ // Contains route information computed for an origin/destination pair in the
345
425
  // ComputeRouteMatrix API. This proto can be streamed to the client.
346
426
  message RouteMatrixElement {
427
+ // Text representations of certain properties.
428
+ message LocalizedValues {
429
+ // Travel distance represented in text form.
430
+ google.type.LocalizedText distance = 1;
431
+
432
+ // Duration represented in text form taking traffic conditions into
433
+ // consideration. Note: If traffic information was not requested, this value
434
+ // is the same value as static_duration.
435
+ google.type.LocalizedText duration = 2;
436
+
437
+ // Duration represented in text form without taking traffic conditions into
438
+ // consideration.
439
+ google.type.LocalizedText static_duration = 3;
440
+
441
+ // Transit fare represented in text form.
442
+ google.type.LocalizedText transit_fare = 4;
443
+ }
444
+
347
445
  // Zero-based index of the origin in the request.
348
446
  optional int32 origin_index = 1;
349
447
 
@@ -381,6 +479,9 @@ message RouteMatrixElement {
381
479
  // used, this field contains detailed information about the fallback response.
382
480
  // Otherwise this field is unset.
383
481
  FallbackInfo fallback_info = 8;
482
+
483
+ // Text representations of properties of the `RouteMatrixElement`.
484
+ LocalizedValues localized_values = 10;
384
485
  }
385
486
 
386
487
  // The condition of the route being returned.
@@ -218,7 +218,11 @@ enum TollPass {
218
218
  US_MI_GROSSE_ILE_TOLL_BRIDGE_PASS_TAG = 37;
219
219
 
220
220
  // MI, USA.
221
- US_MI_IQ_PROX_CARD = 38;
221
+ // Deprecated as this pass type no longer exists.
222
+ US_MI_IQ_PROX_CARD = 38 [deprecated = true];
223
+
224
+ // MI, USA.
225
+ US_MI_IQ_TAG = 95;
222
226
 
223
227
  // MI, USA.
224
228
  US_MI_MACKINAC_BRIDGE_MAC_PASS = 39;
@@ -265,6 +269,9 @@ enum TollPass {
265
269
  // SC, USA.
266
270
  US_SC_PALPASS = 47;
267
271
 
272
+ // TX, USA.
273
+ US_TX_AVI_TAG = 97;
274
+
268
275
  // TX, USA.
269
276
  US_TX_BANCPASS = 48;
270
277
 
@@ -286,6 +293,9 @@ enum TollPass {
286
293
  // TX, USA.
287
294
  US_TX_EZTAG = 54;
288
295
 
296
+ // TX, USA.
297
+ US_TX_FUEGO_TAG = 96;
298
+
289
299
  // TX, USA.
290
300
  US_TX_LAREDO_TRADE_TAG = 55;
291
301
 
@@ -0,0 +1,52 @@
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
+
15
+ syntax = "proto3";
16
+
17
+ package google.maps.routing.v2;
18
+
19
+ option cc_enable_arenas = true;
20
+ option csharp_namespace = "Google.Maps.Routing.V2";
21
+ option go_package = "cloud.google.com/go/maps/routing/apiv2/routingpb;routingpb";
22
+ option java_multiple_files = true;
23
+ option java_outer_classname = "TrafficModelProto";
24
+ option java_package = "com.google.maps.routing.v2";
25
+ option objc_class_prefix = "GMRV2";
26
+ option php_namespace = "Google\\Maps\\Routing\\V2";
27
+ option ruby_package = "Google::Maps::Routing::V2";
28
+
29
+ // Specifies the assumptions to use when calculating time in traffic. This
30
+ // setting affects the value returned in the `duration` field in the
31
+ // response, which contains the predicted time in traffic based on historical
32
+ // averages.
33
+ enum TrafficModel {
34
+ // Unused. If specified, will default to `BEST_GUESS`.
35
+ TRAFFIC_MODEL_UNSPECIFIED = 0;
36
+
37
+ // Indicates that the returned `duration` should be the best
38
+ // estimate of travel time given what is known about both historical traffic
39
+ // conditions and live traffic. Live traffic becomes more important the closer
40
+ // the `departure_time` is to now.
41
+ BEST_GUESS = 1;
42
+
43
+ // Indicates that the returned duration should be longer than the
44
+ // actual travel time on most days, though occasional days with particularly
45
+ // bad traffic conditions may exceed this value.
46
+ PESSIMISTIC = 2;
47
+
48
+ // Indicates that the returned duration should be shorter than the actual
49
+ // travel time on most days, though occasional days with particularly good
50
+ // traffic conditions may be faster than this value.
51
+ OPTIMISTIC = 3;
52
+ }
@@ -0,0 +1,161 @@
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
+
15
+ syntax = "proto3";
16
+
17
+ package google.maps.routing.v2;
18
+
19
+ import "google/maps/routing/v2/location.proto";
20
+ import "google/type/localized_text.proto";
21
+
22
+ option cc_enable_arenas = true;
23
+ option csharp_namespace = "Google.Maps.Routing.V2";
24
+ option go_package = "cloud.google.com/go/maps/routing/apiv2/routingpb;routingpb";
25
+ option java_multiple_files = true;
26
+ option java_outer_classname = "TransitProto";
27
+ option java_package = "com.google.maps.routing.v2";
28
+ option objc_class_prefix = "GMRV2";
29
+ option php_namespace = "Google\\Maps\\Routing\\V2";
30
+ option ruby_package = "Google::Maps::Routing::V2";
31
+
32
+ // A transit agency that operates a transit line.
33
+ message TransitAgency {
34
+ // The name of this transit agency.
35
+ string name = 1;
36
+
37
+ // The transit agency's locale-specific formatted phone number.
38
+ string phone_number = 2;
39
+
40
+ // The transit agency's URI.
41
+ string uri = 3;
42
+ }
43
+
44
+ // Contains information about the transit line used in this step.
45
+ message TransitLine {
46
+ // The transit agency (or agencies) that operates this transit line.
47
+ repeated TransitAgency agencies = 1;
48
+
49
+ // The full name of this transit line, For example, "8 Avenue Local".
50
+ string name = 2;
51
+
52
+ // the URI for this transit line as provided by the transit agency.
53
+ string uri = 3;
54
+
55
+ // The color commonly used in signage for this line. Represented in
56
+ // hexadecimal.
57
+ string color = 4;
58
+
59
+ // The URI for the icon associated with this line.
60
+ string icon_uri = 5;
61
+
62
+ // The short name of this transit line. This name will normally be a line
63
+ // number, such as "M7" or "355".
64
+ string name_short = 6;
65
+
66
+ // The color commonly used in text on signage for this line. Represented in
67
+ // hexadecimal.
68
+ string text_color = 7;
69
+
70
+ // The type of vehicle that operates on this transit line.
71
+ TransitVehicle vehicle = 8;
72
+ }
73
+
74
+ // Information about a transit stop.
75
+ message TransitStop {
76
+ // The name of the transit stop.
77
+ string name = 1;
78
+
79
+ // The location of the stop expressed in latitude/longitude coordinates.
80
+ Location location = 2;
81
+ }
82
+
83
+ // Information about a vehicle used in transit routes.
84
+ message TransitVehicle {
85
+ // The type of vehicles for transit routes.
86
+ enum TransitVehicleType {
87
+ // Unused.
88
+ TRANSIT_VEHICLE_TYPE_UNSPECIFIED = 0;
89
+
90
+ // Bus.
91
+ BUS = 1;
92
+
93
+ // A vehicle that operates on a cable, usually on the ground. Aerial cable
94
+ // cars may be of the type `GONDOLA_LIFT`.
95
+ CABLE_CAR = 2;
96
+
97
+ // Commuter rail.
98
+ COMMUTER_TRAIN = 3;
99
+
100
+ // Ferry.
101
+ FERRY = 4;
102
+
103
+ // A vehicle that is pulled up a steep incline by a cable. A Funicular
104
+ // typically consists of two cars, with each car acting as a counterweight
105
+ // for the other.
106
+ FUNICULAR = 5;
107
+
108
+ // An aerial cable car.
109
+ GONDOLA_LIFT = 6;
110
+
111
+ // Heavy rail.
112
+ HEAVY_RAIL = 7;
113
+
114
+ // High speed train.
115
+ HIGH_SPEED_TRAIN = 8;
116
+
117
+ // Intercity bus.
118
+ INTERCITY_BUS = 9;
119
+
120
+ // Long distance train.
121
+ LONG_DISTANCE_TRAIN = 10;
122
+
123
+ // Light rail transit.
124
+ METRO_RAIL = 11;
125
+
126
+ // Monorail.
127
+ MONORAIL = 12;
128
+
129
+ // All other vehicles.
130
+ OTHER = 13;
131
+
132
+ // Rail.
133
+ RAIL = 14;
134
+
135
+ // Share taxi is a kind of bus with the ability to drop off and pick up
136
+ // passengers anywhere on its route.
137
+ SHARE_TAXI = 15;
138
+
139
+ // Underground light rail.
140
+ SUBWAY = 16;
141
+
142
+ // Above ground light rail.
143
+ TRAM = 17;
144
+
145
+ // Trolleybus.
146
+ TROLLEYBUS = 18;
147
+ }
148
+
149
+ // The name of this vehicle, capitalized.
150
+ google.type.LocalizedText name = 1;
151
+
152
+ // The type of vehicle used.
153
+ TransitVehicleType type = 2;
154
+
155
+ // The URI for an icon associated with this vehicle type.
156
+ string icon_uri = 3;
157
+
158
+ // The URI for the icon associated with this vehicle type, based on the local
159
+ // transport signage.
160
+ string local_icon_uri = 4;
161
+ }
@@ -0,0 +1,75 @@
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
+
15
+ syntax = "proto3";
16
+
17
+ package google.maps.routing.v2;
18
+
19
+ option cc_enable_arenas = true;
20
+ option csharp_namespace = "Google.Maps.Routing.V2";
21
+ option go_package = "cloud.google.com/go/maps/routing/apiv2/routingpb;routingpb";
22
+ option java_multiple_files = true;
23
+ option java_outer_classname = "TransitPreferencesProto";
24
+ option java_package = "com.google.maps.routing.v2";
25
+ option objc_class_prefix = "GMRV2";
26
+ option php_namespace = "Google\\Maps\\Routing\\V2";
27
+ option ruby_package = "Google::Maps::Routing::V2";
28
+
29
+ // Preferences for `TRANSIT` based routes that influence the route that is
30
+ // returned.
31
+ message TransitPreferences {
32
+ // A set of values used to specify the mode of transit.
33
+ enum TransitTravelMode {
34
+ // No transit travel mode specified.
35
+ TRANSIT_TRAVEL_MODE_UNSPECIFIED = 0;
36
+
37
+ // Travel by bus.
38
+ BUS = 1;
39
+
40
+ // Travel by subway.
41
+ SUBWAY = 2;
42
+
43
+ // Travel by train.
44
+ TRAIN = 3;
45
+
46
+ // Travel by light rail or tram.
47
+ LIGHT_RAIL = 4;
48
+
49
+ // Travel by rail. This is equivalent to a combination of `SUBWAY`, `TRAIN`,
50
+ // and `LIGHT_RAIL`.
51
+ RAIL = 5;
52
+ }
53
+
54
+ // Specifies routing preferences for transit routes.
55
+ enum TransitRoutingPreference {
56
+ // No preference specified.
57
+ TRANSIT_ROUTING_PREFERENCE_UNSPECIFIED = 0;
58
+
59
+ // Indicates that the calculated route should prefer limited amounts of
60
+ // walking.
61
+ LESS_WALKING = 1;
62
+
63
+ // Indicates that the calculated route should prefer a limited number of
64
+ // transfers.
65
+ FEWER_TRANSFERS = 2;
66
+ }
67
+
68
+ // A set of travel modes to use when getting a `TRANSIT` route. Defaults to
69
+ // all supported modes of travel.
70
+ repeated TransitTravelMode allowed_travel_modes = 1;
71
+
72
+ // A routing preference that, when specified, influences the `TRANSIT` route
73
+ // returned.
74
+ TransitRoutingPreference routing_preference = 2;
75
+ }
@@ -28,10 +28,10 @@ option objc_class_prefix = "GMRV2";
28
28
  option php_namespace = "Google\\Maps\\Routing\\V2";
29
29
  option ruby_package = "Google::Maps::Routing::V2";
30
30
 
31
- // Encapsulates the vehicle information, such as the license plate last
32
- // character.
31
+ // Contains the vehicle information, such as the vehicle emission type.
33
32
  message VehicleInfo {
34
33
  // Describes the vehicle's emission type.
35
- // Applies only to the `DRIVE` travel mode.
34
+ // Applies only to the `DRIVE`
35
+ // [RouteTravelMode][google.maps.routing.v2.RouteTravelMode].
36
36
  VehicleEmissionType emission_type = 2;
37
37
  }