Skip to content

Commit 44bfca5

Browse files
feat: add Eco Routes feature to ComputeRoutes (#3467)
feat: add Eco Routes feature to ComputeRoutes feat: add Route Token feature to ComputeRoutes feat: add Fuel Consumption feature to ComputeRoutes PiperOrigin-RevId: 485094668 Source-Link: googleapis/googleapis@27dd49e Source-Link: googleapis/googleapis-gen@4e7fe2b Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLW1hcHMtcm91dGluZy8uT3dsQm90LnlhbWwiLCJoIjoiNGU3ZmUyYmU3ZTA0ZWQ1NGI2MzY4MjEzM2JkMWQyZjdlNmJjOGQxMSJ9 See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
1 parent 45d8a38 commit 44bfca5

11 files changed

Lines changed: 423 additions & 5 deletions

File tree

packages/google-maps-routing/protos/google/maps/routing/v2/route.proto

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ import "google/geo/type/viewport.proto";
2020
import "google/maps/routing/v2/location.proto";
2121
import "google/maps/routing/v2/navigation_instruction.proto";
2222
import "google/maps/routing/v2/polyline.proto";
23+
import "google/maps/routing/v2/route_label.proto";
2324
import "google/maps/routing/v2/speed_reading_interval.proto";
2425
import "google/maps/routing/v2/toll_info.proto";
2526
import "google/protobuf/duration.proto";
@@ -37,6 +38,10 @@ option ruby_package = "Google::Maps::Routing::V2";
3738
// Encapsulates a route, which consists of a series of connected road segments
3839
// that join beginning, ending, and intermediate waypoints.
3940
message Route {
41+
// Labels for the `Route` that are useful to identify specific properties
42+
// of the route to compare against others.
43+
repeated RouteLabel route_labels = 13;
44+
4045
// A collection of legs (path segments between waypoints) that make-up the
4146
// route. Each leg corresponds to the trip between two non-`via` Waypoints.
4247
// For example, a route with no intermediate waypoints has only one leg. A
@@ -75,6 +80,13 @@ message Route {
7580

7681
// Additional information about the route.
7782
RouteTravelAdvisory travel_advisory = 9;
83+
84+
// Web-safe base64 encoded route token that can be passed to NavigationSDK,
85+
// which allows NavigationSDK to reconstruct the route during navigation, and
86+
// 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.
89+
string route_token = 12;
7890
}
7991

8092
// Encapsulates the additional information that the user should be informed
@@ -98,6 +110,9 @@ message RouteTravelAdvisory {
98110
// polyline: A ---- B ---- C ---- D ---- E ---- F ---- G
99111
// speed_reading_intervals: [A,C), [C,D), [D,G).
100112
repeated SpeedReadingInterval speed_reading_intervals = 3;
113+
114+
// The fuel consumption prediction in microliters.
115+
int64 fuel_consumption_microliters = 5;
101116
}
102117

103118
// Encapsulates the additional information that the user should be informed
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
// Copyright 2022 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 = "google.golang.org/genproto/googleapis/maps/routing/v2;routing";
22+
option java_multiple_files = true;
23+
option java_outer_classname = "RouteLabelProto";
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+
// Labels for the `Route` that are useful to identify specific properties
30+
// of the route to compare against others.
31+
enum RouteLabel {
32+
// Default - not used.
33+
ROUTE_LABEL_UNSPECIFIED = 0;
34+
35+
// The default "best" route returned for the route computation.
36+
DEFAULT_ROUTE = 1;
37+
38+
// An alternative to the default "best" route. Routes like this will be
39+
// returned when `ComputeRoutesRequest.compute_alternative_routes` is
40+
// specified.
41+
DEFAULT_ROUTE_ALTERNATE = 2;
42+
43+
// Fuel efficient route. Routes labeled with this value are determined to be
44+
// optimized for Eco parameters such as fuel consumption.
45+
FUEL_EFFICIENT = 3;
46+
}

packages/google-maps-routing/protos/google/maps/routing/v2/routes_service.proto

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,16 @@ service Routes {
132132

133133
// ComputeRoutes request message.
134134
message ComputeRoutesRequest {
135+
// A supported reference route on the ComputeRoutesRequest.
136+
enum ReferenceRoute {
137+
// Not used. Requests containing this value fail.
138+
REFERENCE_ROUTE_UNSPECIFIED = 0;
139+
140+
// Fuel efficient route. Routes labeled with this value are determined to be
141+
// optimized for parameters such as fuel consumption.
142+
FUEL_EFFICIENT = 1;
143+
}
144+
135145
// Required. Origin waypoint.
136146
Waypoint origin = 1 [(google.api.field_behavior) = REQUIRED];
137147

@@ -187,6 +197,14 @@ message ComputeRoutesRequest {
187197
// affected by this value. If you don't provide this value, then the display
188198
// units are inferred from the location of the request.
189199
Units units = 11 [(google.api.field_behavior) = OPTIONAL];
200+
201+
// Optional. Specifies what reference routes to calculate as part of the request in
202+
// addition to the default route.
203+
// A reference route is a route with a different route calculation objective
204+
// than the default route. For example an FUEL_EFFICIENT reference route
205+
// calculation takes into account various parameters that would generate an
206+
// optimal fuel efficient route.
207+
repeated ReferenceRoute requested_reference_routes = 14 [(google.api.field_behavior) = OPTIONAL];
190208
}
191209

192210
// ComputeRoutes the response message.

packages/google-maps-routing/protos/google/maps/routing/v2/vehicle_emission_type.proto

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,4 +40,7 @@ enum VehicleEmissionType {
4040

4141
// Hybrid fuel (such as gasoline + electric) vehicle.
4242
HYBRID = 3;
43+
44+
// Diesel fueled vehicle.
45+
DIESEL = 4;
4346
}

packages/google-maps-routing/protos/protos.d.ts

Lines changed: 43 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)