@googlemaps/routing 0.5.0 → 0.6.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.
Files changed (34) hide show
  1. package/CHANGELOG.md +15 -0
  2. package/README.md +5 -6
  3. package/build/protos/google/maps/routing/v2/fallback_info.proto +1 -1
  4. package/build/protos/google/maps/routing/v2/geocoding_results.proto +1 -1
  5. package/build/protos/google/maps/routing/v2/localized_time.proto +40 -0
  6. package/build/protos/google/maps/routing/v2/location.proto +5 -5
  7. package/build/protos/google/maps/routing/v2/maneuver.proto +7 -1
  8. package/build/protos/google/maps/routing/v2/navigation_instruction.proto +1 -1
  9. package/build/protos/google/maps/routing/v2/polyline.proto +1 -1
  10. package/build/protos/google/maps/routing/v2/route.proto +221 -45
  11. package/build/protos/google/maps/routing/v2/route_label.proto +1 -1
  12. package/build/protos/google/maps/routing/v2/route_modifiers.proto +10 -12
  13. package/build/protos/google/maps/routing/v2/route_travel_mode.proto +4 -1
  14. package/build/protos/google/maps/routing/v2/routes_service.proto +111 -10
  15. package/build/protos/google/maps/routing/v2/routing_preference.proto +1 -1
  16. package/build/protos/google/maps/routing/v2/speed_reading_interval.proto +1 -1
  17. package/build/protos/google/maps/routing/v2/toll_info.proto +1 -1
  18. package/build/protos/google/maps/routing/v2/toll_passes.proto +12 -2
  19. package/build/protos/google/maps/routing/v2/traffic_model.proto +52 -0
  20. package/build/protos/google/maps/routing/v2/transit.proto +161 -0
  21. package/build/protos/google/maps/routing/v2/transit_preferences.proto +75 -0
  22. package/build/protos/google/maps/routing/v2/units.proto +1 -1
  23. package/build/protos/google/maps/routing/v2/vehicle_emission_type.proto +1 -1
  24. package/build/protos/google/maps/routing/v2/vehicle_info.proto +4 -4
  25. package/build/protos/google/maps/routing/v2/waypoint.proto +1 -1
  26. package/build/protos/protos.d.ts +2153 -186
  27. package/build/protos/protos.js +5691 -382
  28. package/build/protos/protos.json +491 -24
  29. package/build/src/v2/routes_client.d.ts +67 -8
  30. package/build/src/v2/routes_client.js +26 -3
  31. package/package.json +11 -8
  32. package/build/src/index.js.map +0 -1
  33. package/build/src/v2/index.js.map +0 -1
  34. package/build/src/v2/routes_client.js.map +0 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,20 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.6.0](https://github.com/googleapis/google-cloud-node/compare/routing-v0.5.1...routing-v0.6.0) (2023-07-04)
4
+
5
+
6
+ ### Features
7
+
8
+ * [routing] Add HTML Navigation Instructions feature to ComputeRoutes ([#4381](https://github.com/googleapis/google-cloud-node/issues/4381)) ([8414c84](https://github.com/googleapis/google-cloud-node/commit/8414c8458133ecc654d25eeb8b0b90c4dac9ff04))
9
+
10
+ ## [0.5.1](https://github.com/googleapis/google-cloud-node/compare/routing-v0.5.0...routing-v0.5.1) (2023-04-13)
11
+
12
+
13
+ ### Bug Fixes
14
+
15
+ * **deps:** Bump `google-gax` to ^3.5.8 ([#4117](https://github.com/googleapis/google-cloud-node/issues/4117)) ([0b67d88](https://github.com/googleapis/google-cloud-node/commit/0b67d883963643ce1b4f6d2ccd3e8d37adf6e029))
16
+ * Minify JSON and JS files, and remove .map files ([#4143](https://github.com/googleapis/google-cloud-node/issues/4143)) ([170f7d5](https://github.com/googleapis/google-cloud-node/commit/170f7d57b8fd344d182a8e758867b8124722eebc))
17
+
3
18
  ## [0.5.0](https://github.com/googleapis/google-cloud-node/compare/routing-v0.4.0...routing-v0.5.0) (2023-03-28)
4
19
 
5
20
 
package/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
  [//]: # "To regenerate it, use `python -m synthtool`."
3
3
  <img src="https://avatars2.githubusercontent.com/u/2810941?v=3&s=96" alt="Google Cloud Platform logo" title="Google Cloud Platform" align="right" height="96" width="96"/>
4
4
 
5
- # [Google Maps Routing: Node.js Client](https://github.com/googleapis/google-cloud-node)
5
+ # [Google Maps Routing: Node.js Client](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-maps-routing)
6
6
 
7
7
  [![release level](https://img.shields.io/badge/release%20level-preview-yellow.svg?style=flat)](https://cloud.google.com/terms/launch-stages)
8
8
  [![npm version](https://img.shields.io/npm/v/@googlemaps/routing.svg)](https://www.npmjs.org/package/@googlemaps/routing)
@@ -158,14 +158,13 @@ callComputeRoutes();
158
158
 
159
159
  ## Samples
160
160
 
161
- Samples are in the [`samples/`](https://github.com/googleapis/google-cloud-node/tree/main/samples) directory. Each sample's `README.md` has instructions for running its sample.
161
+ Samples are in the [`samples/`](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-maps-routing/samples) directory. Each sample's `README.md` has instructions for running its sample.
162
162
 
163
163
  | Sample | Source Code | Try it |
164
164
  | --------------------------- | --------------------------------- | ------ |
165
- | Routes.compute_route_matrix | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-maps-routing/samples/generated/v2/routes.compute_route_matrix.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-maps-routing/samples/generated/v2/routes.compute_route_matrix.js,samples/README.md) |
166
- | Routes.compute_routes | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-maps-routing/samples/generated/v2/routes.compute_routes.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-maps-routing/samples/generated/v2/routes.compute_routes.js,samples/README.md) |
167
- | Quickstart | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-maps-routing/samples/quickstart.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-maps-routing/samples/quickstart.js,samples/README.md) |
168
- | Quickstart | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-maps-routing/samples/test/quickstart.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-maps-routing/samples/test/quickstart.js,samples/README.md) |
165
+ | Routes.compute_route_matrix | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-maps-routing/samples/generated/v2/routes.compute_route_matrix.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-maps-routing/samples/generated/v2/routes.compute_route_matrix.js,packages/google-maps-routing/samples/README.md) |
166
+ | Routes.compute_routes | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-maps-routing/samples/generated/v2/routes.compute_routes.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-maps-routing/samples/generated/v2/routes.compute_routes.js,packages/google-maps-routing/samples/README.md) |
167
+ | Quickstart | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-maps-routing/samples/quickstart.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-maps-routing/samples/quickstart.js,packages/google-maps-routing/samples/README.md) |
169
168
 
170
169
 
171
170
 
@@ -18,7 +18,7 @@ package google.maps.routing.v2;
18
18
 
19
19
  option cc_enable_arenas = true;
20
20
  option csharp_namespace = "Google.Maps.Routing.V2";
21
- option go_package = "google.golang.org/genproto/googleapis/maps/routing/v2;routing";
21
+ option go_package = "cloud.google.com/go/maps/routing/apiv2/routingpb;routingpb";
22
22
  option java_multiple_files = true;
23
23
  option java_outer_classname = "FallbackInfoProto";
24
24
  option java_package = "com.google.maps.routing.v2";
@@ -20,7 +20,7 @@ import "google/rpc/status.proto";
20
20
 
21
21
  option cc_enable_arenas = true;
22
22
  option csharp_namespace = "Google.Maps.Routing.V2";
23
- option go_package = "google.golang.org/genproto/googleapis/maps/routing/v2;routing";
23
+ option go_package = "cloud.google.com/go/maps/routing/apiv2/routingpb;routingpb";
24
24
  option java_multiple_files = true;
25
25
  option java_outer_classname = "GeocodingResultsProto";
26
26
  option java_package = "com.google.maps.routing.v2";
@@ -0,0 +1,40 @@
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/type/localized_text.proto";
20
+
21
+ option cc_enable_arenas = true;
22
+ option csharp_namespace = "Google.Maps.Routing.V2";
23
+ option go_package = "cloud.google.com/go/maps/routing/apiv2/routingpb;routingpb";
24
+ option java_multiple_files = true;
25
+ option java_outer_classname = "LocalizedTimeProto";
26
+ option java_package = "com.google.maps.routing.v2";
27
+ option objc_class_prefix = "GMRV2";
28
+ option php_namespace = "Google\\Maps\\Routing\\V2";
29
+ option ruby_package = "Google::Maps::Routing::V2";
30
+
31
+ // Localized description of time.
32
+ message LocalizedTime {
33
+ // The time specified as a string in a given time zone.
34
+ google.type.LocalizedText time = 1;
35
+
36
+ // Contains the time zone. The value is the name of the time zone as defined
37
+ // in the [IANA Time Zone Database](http://www.iana.org/time-zones), e.g.
38
+ // "America/New_York".
39
+ string time_zone = 2;
40
+ }
@@ -21,7 +21,7 @@ import "google/type/latlng.proto";
21
21
 
22
22
  option cc_enable_arenas = true;
23
23
  option csharp_namespace = "Google.Maps.Routing.V2";
24
- option go_package = "google.golang.org/genproto/googleapis/maps/routing/v2;routing";
24
+ option go_package = "cloud.google.com/go/maps/routing/apiv2/routingpb;routingpb";
25
25
  option java_multiple_files = true;
26
26
  option java_outer_classname = "LocationProto";
27
27
  option java_package = "com.google.maps.routing.v2";
@@ -35,10 +35,10 @@ message Location {
35
35
  google.type.LatLng lat_lng = 1;
36
36
 
37
37
  // The compass heading associated with the direction of the flow of traffic.
38
- // This value is used to specify the side of the road to use for pickup and
39
- // drop-off. Heading values can be from 0 to 360, where 0 specifies a heading
40
- // of due North, 90 specifies a heading of due East, etc. You can use this
41
- // field only for `DRIVE` and `TWO_WHEELER`
38
+ // This value specifies the side of the road for pickup and drop-off. Heading
39
+ // values can be from 0 to 360, where 0 specifies a heading of due North, 90
40
+ // specifies a heading of due East, and so on. You can use this field only for
41
+ // `DRIVE` and `TWO_WHEELER`
42
42
  // [RouteTravelMode][google.maps.routing.v2.RouteTravelMode].
43
43
  google.protobuf.Int32Value heading = 2;
44
44
  }
@@ -18,7 +18,7 @@ package google.maps.routing.v2;
18
18
 
19
19
  option cc_enable_arenas = true;
20
20
  option csharp_namespace = "Google.Maps.Routing.V2";
21
- option go_package = "google.golang.org/genproto/googleapis/maps/routing/v2;routing";
21
+ option go_package = "cloud.google.com/go/maps/routing/apiv2/routingpb;routingpb";
22
22
  option java_multiple_files = true;
23
23
  option java_outer_classname = "ManeuverProto";
24
24
  option java_package = "com.google.maps.routing.v2";
@@ -85,4 +85,10 @@ enum Maneuver {
85
85
 
86
86
  // Turn right at the roundabout.
87
87
  ROUNDABOUT_RIGHT = 18;
88
+
89
+ // Initial maneuver.
90
+ DEPART = 19;
91
+
92
+ // Used to indicate a street name change.
93
+ NAME_CHANGE = 20;
88
94
  }
@@ -20,7 +20,7 @@ import "google/maps/routing/v2/maneuver.proto";
20
20
 
21
21
  option cc_enable_arenas = true;
22
22
  option csharp_namespace = "Google.Maps.Routing.V2";
23
- option go_package = "google.golang.org/genproto/googleapis/maps/routing/v2;routing";
23
+ option go_package = "cloud.google.com/go/maps/routing/apiv2/routingpb;routingpb";
24
24
  option java_multiple_files = true;
25
25
  option java_outer_classname = "NavigationInstructionProto";
26
26
  option java_package = "com.google.maps.routing.v2";
@@ -20,7 +20,7 @@ import "google/protobuf/struct.proto";
20
20
 
21
21
  option cc_enable_arenas = true;
22
22
  option csharp_namespace = "Google.Maps.Routing.V2";
23
- option go_package = "google.golang.org/genproto/googleapis/maps/routing/v2;routing";
23
+ option go_package = "cloud.google.com/go/maps/routing/apiv2/routingpb;routingpb";
24
24
  option java_multiple_files = true;
25
25
  option java_outer_classname = "PolylineProto";
26
26
  option java_package = "com.google.maps.routing.v2";
@@ -17,17 +17,23 @@ syntax = "proto3";
17
17
  package google.maps.routing.v2;
18
18
 
19
19
  import "google/geo/type/viewport.proto";
20
+ import "google/maps/routing/v2/localized_time.proto";
20
21
  import "google/maps/routing/v2/location.proto";
21
22
  import "google/maps/routing/v2/navigation_instruction.proto";
22
23
  import "google/maps/routing/v2/polyline.proto";
23
24
  import "google/maps/routing/v2/route_label.proto";
25
+ import "google/maps/routing/v2/route_travel_mode.proto";
24
26
  import "google/maps/routing/v2/speed_reading_interval.proto";
25
27
  import "google/maps/routing/v2/toll_info.proto";
28
+ import "google/maps/routing/v2/transit.proto";
26
29
  import "google/protobuf/duration.proto";
30
+ import "google/protobuf/timestamp.proto";
31
+ import "google/type/localized_text.proto";
32
+ import "google/type/money.proto";
27
33
 
28
34
  option cc_enable_arenas = true;
29
35
  option csharp_namespace = "Google.Maps.Routing.V2";
30
- option go_package = "google.golang.org/genproto/googleapis/maps/routing/v2;routing";
36
+ option go_package = "cloud.google.com/go/maps/routing/apiv2/routingpb;routingpb";
31
37
  option java_multiple_files = true;
32
38
  option java_outer_classname = "RouteProto";
33
39
  option java_package = "com.google.maps.routing.v2";
@@ -35,20 +41,38 @@ option objc_class_prefix = "GMRV2";
35
41
  option php_namespace = "Google\\Maps\\Routing\\V2";
36
42
  option ruby_package = "Google::Maps::Routing::V2";
37
43
 
38
- // Encapsulates a route, which consists of a series of connected road segments
44
+ // Contains a route, which consists of a series of connected road segments
39
45
  // that join beginning, ending, and intermediate waypoints.
40
46
  message 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
58
+ // consideration, 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
+
41
65
  // Labels for the `Route` that are useful to identify specific properties
42
66
  // of the route to compare against others.
43
67
  repeated RouteLabel route_labels = 13;
44
68
 
45
- // A collection of legs (path segments between waypoints) that make-up the
69
+ // A collection of legs (path segments between waypoints) that make up the
46
70
  // route. Each leg corresponds to the trip between two non-`via`
47
71
  // [Waypoints][google.maps.routing.v2.Waypoint]. For example, a route with no
48
72
  // intermediate waypoints has only one leg. A route that includes one
49
73
  // non-`via` intermediate waypoint has two legs. A route that includes one
50
74
  // `via` intermediate waypoint has one leg. The order of the legs matches the
51
- // order of Waypoints from `origin` to `intermediates` to `destination`.
75
+ // order of waypoints from `origin` to `intermediates` to `destination`.
52
76
  repeated RouteLeg legs = 1;
53
77
 
54
78
  // The travel distance of the route, in meters.
@@ -61,11 +85,11 @@ message Route {
61
85
  // taking traffic conditions into account.
62
86
  google.protobuf.Duration duration = 3;
63
87
 
64
- // The duration of traveling through the route without taking traffic
88
+ // The duration of travel through the route without taking traffic
65
89
  // conditions into consideration.
66
90
  google.protobuf.Duration static_duration = 4;
67
91
 
68
- // The overall route polyline. This polyline will be the combined polyline of
92
+ // The overall route polyline. This polyline is the combined polyline of
69
93
  // all `legs`.
70
94
  Polyline polyline = 5;
71
95
 
@@ -81,26 +105,40 @@ message Route {
81
105
  // Additional information about the route.
82
106
  RouteTravelAdvisory travel_advisory = 9;
83
107
 
84
- // Web-safe base64 encoded route token that can be passed to NavigationSDK,
85
- // which allows the Navigation SDK to reconstruct the route during navigation,
86
- // and in the event of rerouting honor the original intention when Routes
87
- // ComputeRoutes is called. Customers should treat this token as an
88
- // opaque blob.
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.
89
127
  // NOTE: `Route.route_token` is only available for requests that have set
90
128
  // `ComputeRoutesRequest.routing_preference` to `TRAFFIC_AWARE` or
91
- // `TRAFFIC_AWARE_OPTIMAL`. `Route.route_token` is also not supported for
92
- // requests that have Via waypoints.
129
+ // `TRAFFIC_AWARE_OPTIMAL`. `Route.route_token` is not supported for requests
130
+ // that have Via waypoints.
93
131
  string route_token = 12;
94
132
  }
95
133
 
96
- // Encapsulates the additional information that the user should be informed
97
- // about, such as possible traffic zone restriction etc.
134
+ // Contains the additional information that the user should be informed
135
+ // about, such as possible traffic zone restrictions.
98
136
  message RouteTravelAdvisory {
99
- // Encapsulates information about tolls on the Route.
100
- // This field is only populated if we expect there are tolls on the Route.
101
- // If this field is set but the estimated_price subfield is not populated,
102
- // we expect that road contains tolls but we do not know an estimated price.
103
- // If this field is not set, then we expect there is no toll on the Route.
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.
104
142
  TollInfo toll_info = 2;
105
143
 
106
144
  // Speed reading intervals detailing traffic density. Applicable in case of
@@ -115,23 +153,33 @@ message RouteTravelAdvisory {
115
153
  // speed_reading_intervals: [A,C), [C,D), [D,G).
116
154
  repeated SpeedReadingInterval speed_reading_intervals = 3;
117
155
 
118
- // The fuel consumption prediction in microliters.
156
+ // The predicted fuel consumption in microliters.
119
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;
120
167
  }
121
168
 
122
- // Encapsulates the additional information that the user should be informed
123
- // about, such as possible traffic zone restriction etc. on a route leg.
169
+ // Contains the additional information that the user should be informed
170
+ // about on a leg step, such as possible traffic zone restrictions.
124
171
  message RouteLegTravelAdvisory {
125
- // Encapsulates information about tolls on the specific RouteLeg.
126
- // This field is only populated if we expect there are tolls on the RouteLeg.
127
- // If this field is set but the estimated_price subfield is not populated,
128
- // we expect that road contains tolls but we do not know an estimated price.
129
- // If this field does not exist, then there is no toll on the RouteLeg.
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`.
130
178
  TollInfo toll_info = 1;
131
179
 
132
180
  // Speed reading intervals detailing traffic density. Applicable in case of
133
181
  // `TRAFFIC_AWARE` and `TRAFFIC_AWARE_OPTIMAL` routing preferences.
134
- // The intervals cover the entire polyline of the RouteLg without overlap.
182
+ // The intervals cover the entire polyline of the `RouteLeg` without overlap.
135
183
  // The start point of a specified interval is the same as the end point of the
136
184
  // preceding interval.
137
185
  //
@@ -142,15 +190,59 @@ message RouteLegTravelAdvisory {
142
190
  repeated SpeedReadingInterval speed_reading_intervals = 2;
143
191
  }
144
192
 
145
- // Encapsulates the additional information that the user should be informed
146
- // about, such as possible traffic zone restriction on a leg step.
193
+ // Contains the additional information that the user should be informed
194
+ // about, such as possible traffic zone restrictions on a leg step.
147
195
  message RouteLegStepTravelAdvisory {
148
196
  // NOTE: This field is not currently populated.
149
197
  repeated SpeedReadingInterval speed_reading_intervals = 1;
150
198
  }
151
199
 
152
- // Encapsulates a segment between non-`via` waypoints.
200
+ // Contains a segment between non-`via` waypoints.
153
201
  message 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
+
154
246
  // The travel distance of the route leg, in meters.
155
247
  int32 distance_meters = 1;
156
248
 
@@ -161,37 +253,54 @@ message RouteLeg {
161
253
  // conditions into account.
162
254
  google.protobuf.Duration duration = 2;
163
255
 
164
- // The duration of traveling through the leg, calculated without taking
256
+ // The duration of travel through the leg, calculated without taking
165
257
  // traffic conditions into consideration.
166
258
  google.protobuf.Duration static_duration = 3;
167
259
 
168
- // The overall polyline for this leg. This includes that each `step`'s
260
+ // The overall polyline for this leg that includes each `step`'s
169
261
  // polyline.
170
262
  Polyline polyline = 4;
171
263
 
172
- // The start location of this leg. This might be different from the provided
173
- // `origin`. For example, when the provided `origin` is not near a road, this
174
- // is a point on the road.
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.
175
267
  Location start_location = 5;
176
268
 
177
- // The end location of this leg. This might be different from the provided
178
- // `destination`. For example, when the provided `destination` is not near a
179
- // road, this is a point on the road.
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.
180
272
  Location end_location = 6;
181
273
 
182
274
  // An array of steps denoting segments within this leg. Each step represents
183
275
  // one navigation instruction.
184
276
  repeated RouteLegStep steps = 7;
185
277
 
186
- // Encapsulates the additional information that the user should be informed
187
- // about, such as possible traffic zone restriction etc. on a route leg.
278
+ // Contains the additional information that the user should be informed
279
+ // about, such as possible traffic zone restrictions, on a route leg.
188
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;
189
288
  }
190
289
 
191
- // Encapsulates a segment of a [RouteLeg][google.maps.routing.v2.RouteLeg]. A
290
+ // Contains a segment of a [RouteLeg][google.maps.routing.v2.RouteLeg]. A
192
291
  // step corresponds to a single navigation instruction. Route legs are made up
193
292
  // of steps.
194
293
  message 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
+
195
304
  // The travel distance of this step, in meters. In some circumstances, this
196
305
  // field might not have a value.
197
306
  int32 distance_meters = 1;
@@ -213,7 +322,74 @@ message RouteLegStep {
213
322
  // Navigation instructions.
214
323
  NavigationInstruction navigation_instruction = 6;
215
324
 
216
- // Encapsulates the additional information that the user should be informed
217
- // about, such as possible traffic zone restriction on a leg step.
325
+ // Contains the additional information that the user should be informed
326
+ // about, such as possible traffic zone restrictions, on a leg step.
218
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.
340
+ message 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;
219
395
  }
@@ -18,7 +18,7 @@ package google.maps.routing.v2;
18
18
 
19
19
  option cc_enable_arenas = true;
20
20
  option csharp_namespace = "Google.Maps.Routing.V2";
21
- option go_package = "google.golang.org/genproto/googleapis/maps/routing/v2;routing";
21
+ option go_package = "cloud.google.com/go/maps/routing/apiv2/routingpb;routingpb";
22
22
  option java_multiple_files = true;
23
23
  option java_outer_classname = "RouteLabelProto";
24
24
  option java_package = "com.google.maps.routing.v2";
@@ -21,7 +21,7 @@ import "google/maps/routing/v2/vehicle_info.proto";
21
21
 
22
22
  option cc_enable_arenas = true;
23
23
  option csharp_namespace = "Google.Maps.Routing.V2";
24
- option go_package = "google.golang.org/genproto/googleapis/maps/routing/v2;routing";
24
+ option go_package = "cloud.google.com/go/maps/routing/apiv2/routingpb;routingpb";
25
25
  option java_multiple_files = true;
26
26
  option java_outer_classname = "RouteModifiersProto";
27
27
  option java_package = "com.google.maps.routing.v2";
@@ -32,26 +32,24 @@ option ruby_package = "Google::Maps::Routing::V2";
32
32
  // Encapsulates a set of optional conditions to satisfy when calculating the
33
33
  // routes.
34
34
  message RouteModifiers {
35
- // Specifies whether to avoid toll roads where reasonable. Preference will be
36
- // given to routes not containing toll roads. Applies only to the `DRIVE` and
35
+ // When set to true, avoids toll roads where reasonable, giving preference to
36
+ // routes not containing toll roads. Applies only to the `DRIVE` and
37
37
  // `TWO_WHEELER` [RouteTravelMode][google.maps.routing.v2.RouteTravelMode].
38
38
  bool avoid_tolls = 1;
39
39
 
40
- // Specifies whether to avoid highways where reasonable. Preference will be
41
- // given to routes not containing highways. Applies only to the `DRIVE` and
40
+ // When set to true, avoids highways where reasonable, giving preference to
41
+ // routes not containing highways. Applies only to the `DRIVE` and
42
42
  // `TWO_WHEELER` [RouteTravelMode][google.maps.routing.v2.RouteTravelMode].
43
43
  bool avoid_highways = 2;
44
44
 
45
- // Specifies whether to avoid ferries where reasonable. Preference will be
46
- // given to routes not containing travel by ferries.
47
- // Applies only to the `DRIVE` and`TWO_WHEELER`
45
+ // When set to true, avoids ferries where reasonable, giving preference to
46
+ // routes not containing ferries. Applies only to the `DRIVE` and`TWO_WHEELER`
48
47
  // [RouteTravelMode][google.maps.routing.v2.RouteTravelMode].
49
48
  bool avoid_ferries = 3;
50
49
 
51
- // Specifies whether to avoid navigating indoors where reasonable. Preference
52
- // will be given to routes not containing indoor navigation.
53
- // Applies only to the `WALK`
54
- // [RouteTravelMode][google.maps.routing.v2.RouteTravelMode].
50
+ // When set to true, avoids navigating indoors where reasonable, giving
51
+ // preference to routes not containing indoor navigation. Applies only to the
52
+ // `WALK` [RouteTravelMode][google.maps.routing.v2.RouteTravelMode].
55
53
  bool avoid_indoor = 4;
56
54
 
57
55
  // Specifies the vehicle information.
@@ -18,7 +18,7 @@ package google.maps.routing.v2;
18
18
 
19
19
  option cc_enable_arenas = true;
20
20
  option csharp_namespace = "Google.Maps.Routing.V2";
21
- option go_package = "google.golang.org/genproto/googleapis/maps/routing/v2;routing";
21
+ option go_package = "cloud.google.com/go/maps/routing/apiv2/routingpb;routingpb";
22
22
  option java_multiple_files = true;
23
23
  option java_outer_classname = "RouteTravelModeProto";
24
24
  option java_package = "com.google.maps.routing.v2";
@@ -47,4 +47,7 @@ enum RouteTravelMode {
47
47
  // Two-wheeled, motorized vehicle. For example, motorcycle. Note that this
48
48
  // differs from the `BICYCLE` travel mode which covers human-powered mode.
49
49
  TWO_WHEELER = 4;
50
+
51
+ // Travel by public transit routes, where available.
52
+ TRANSIT = 7;
50
53
  }