Skip to content

Commit d0b394f

Browse files
Google APIscopybara-github
authored andcommitted
feat: added support for custom layer info
Clients can now specify the custom dataset use to annotate route PiperOrigin-RevId: 456358187
1 parent 3b9c451 commit d0b394f

15 files changed

Lines changed: 323 additions & 32 deletions

google/maps/routes/v1/compute_custom_routes_request.proto

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2021 Google LLC
1+
// Copyright 2022 Google LLC
22
//
33
// Licensed under the Apache License, Version 2.0 (the "License");
44
// you may not use this file except in compliance with the License.
@@ -108,9 +108,34 @@ message RouteObjective {
108108
bool include_tolls = 4 [(google.api.field_behavior) = OPTIONAL];
109109
}
110110

111+
// Customized data layer that customers use to generated route annotations or
112+
// influence the generated route.
113+
message CustomLayer {
114+
// Information about a dataset that customers uploaded in advance. The
115+
// dataset information will be used for generating route annotations or to
116+
// influence routing.
117+
message DatasetInfo {
118+
// Required. ID of a customer uploaded dataset for which will be used to annotate or
119+
// influence the route. If the dataset does not exist or is not yet ready,
120+
// the request will fail.
121+
string dataset_id = 1 [(google.api.field_behavior) = REQUIRED];
122+
}
123+
124+
// Required. A dataset that the customer uploaded in advance.
125+
DatasetInfo dataset_info = 1 [(google.api.field_behavior) = REQUIRED];
126+
}
127+
111128
// The route objective.
112129
oneof objective {
113130
// The RateCard objective.
114131
RateCard rate_card = 1;
115132
}
133+
134+
// Optional. Specifies the custom data layer being used to affect generated routes.
135+
// Customers can turn off the custom layer by not setting this field. Once a
136+
// custom layer is being set, the custom layer will be used to generate route
137+
// annotations (CustomLayerInfo) in the returned routes, the annotations can
138+
// be turned off using `X-Goog-FieldMask` header (see
139+
// https://cloud.google.com/apis/docs/system-parameters).
140+
CustomLayer custom_layer = 2 [(google.api.field_behavior) = OPTIONAL];
116141
}

google/maps/routes/v1/compute_custom_routes_response.proto

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2021 Google LLC
1+
// Copyright 2022 Google LLC
22
//
33
// Licensed under the Apache License, Version 2.0 (the "License");
44
// you may not use this file except in compliance with the License.

google/maps/routes/v1/compute_route_matrix_request.proto

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2021 Google LLC
1+
// Copyright 2022 Google LLC
22
//
33
// Licensed under the Apache License, Version 2.0 (the "License");
44
// you may not use this file except in compliance with the License.

google/maps/routes/v1/compute_routes_request.proto

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2021 Google LLC
1+
// Copyright 2022 Google LLC
22
//
33
// Licensed under the Apache License, Version 2.0 (the "License");
44
// you may not use this file except in compliance with the License.
@@ -88,6 +88,16 @@ message ComputeRoutesRequest {
8888
// affected by this value. If you don't provide this value, then the display
8989
// units are inferred from the location of the request.
9090
Units units = 11;
91+
92+
// If optimizeWaypointOrder is set to true, an attempt is made to re-order the
93+
// specified intermediate waypoints to minimize the overall cost of the route.
94+
// If any of the intermediate waypoints is via waypoint the request fails. Use
95+
// ComputeRoutesResponse.Routes.optimized_intermediate_waypoint_index to find
96+
// the new ordering. If routes.optimized_intermediate_waypoint_index is not
97+
// requested in the `X-Goog-FieldMask` header, the request fails. If
98+
// optimizeWaypointOrder is set to false,
99+
// ComputeRoutesResponse.optimized_intermediate_waypoint_index is empty.
100+
bool optimize_waypoint_order = 13;
91101
}
92102

93103
// Encapsulates a set of optional conditions to satisfy when calculating the

google/maps/routes/v1/compute_routes_response.proto

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2021 Google LLC
1+
// Copyright 2022 Google LLC
22
//
33
// Licensed under the Apache License, Version 2.0 (the "License");
44
// you may not use this file except in compliance with the License.

google/maps/routes/v1/custom_route.proto

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2021 Google LLC
1+
// Copyright 2022 Google LLC
22
//
33
// Licensed under the Apache License, Version 2.0 (the "License");
44
// you may not use this file except in compliance with the License.

google/maps/routes/v1/fallback_info.proto

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2021 Google LLC
1+
// Copyright 2022 Google LLC
22
//
33
// Licensed under the Apache License, Version 2.0 (the "License");
44
// you may not use this file except in compliance with the License.

google/maps/routes/v1/polyline.proto

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2021 Google LLC
1+
// Copyright 2022 Google LLC
22
//
33
// Licensed under the Apache License, Version 2.0 (the "License");
44
// you may not use this file except in compliance with the License.

google/maps/routes/v1/route.proto

Lines changed: 47 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2021 Google LLC
1+
// Copyright 2022 Google LLC
22
//
33
// Licensed under the Apache License, Version 2.0 (the "License");
44
// you may not use this file except in compliance with the License.
@@ -72,6 +72,16 @@ message Route {
7272

7373
// Additional information about the route.
7474
RouteTravelAdvisory travel_advisory = 9;
75+
76+
// If ComputeRoutesRequest.optimize_waypoint_order is set to true, this field
77+
// contains the optimized ordering of intermediates waypoints.
78+
// otherwise, this field is empty.
79+
// For example, suppose the input is Origin: LA; Intermediates: Dallas,
80+
// Bangor, Phoenix; Destination: New York; and the optimized intermediate
81+
// waypoint order is: Phoenix, Dallas, Bangor. Then this field contains the
82+
// values [2, 0, 1]. The index starts with 0 for the first intermediate
83+
// waypoint.
84+
repeated int32 optimized_intermediate_waypoint_index = 10;
7585
}
7686

7787
// Encapsulates the additional information that the user should be informed
@@ -100,6 +110,10 @@ message RouteTravelAdvisory {
100110
// polyline: A ---- B ---- C ---- D ---- E ---- F ---- G
101111
// speed_reading_intervals: [A,C), [C,D), [D,G).
102112
repeated SpeedReadingInterval speed_reading_intervals = 3;
113+
114+
// Information related to the custom layer data that the customer specified
115+
// (e.g. time spent in a customer specified area).
116+
CustomLayerInfo custom_layer_info = 4;
103117
}
104118

105119
// Encapsulates the additional information that the user should be informed
@@ -123,6 +137,10 @@ message RouteLegTravelAdvisory {
123137
// polyline: A ---- B ---- C ---- D ---- E ---- F ---- G
124138
// speed_reading_intervals: [A,C), [C,D), [D,G).
125139
repeated SpeedReadingInterval speed_reading_intervals = 2;
140+
141+
// Information related to the custom layer data that the customer specified
142+
// (e.g. time spent in a customer specified area).
143+
CustomLayerInfo custom_layer_info = 3;
126144
}
127145

128146
// Encapsulates the additional information that the user should be informed
@@ -337,3 +355,31 @@ message SpeedReadingInterval {
337355
// Traffic speed in this interval.
338356
Speed speed = 3;
339357
}
358+
359+
// Encapsulates statistics about the time spent and distance travelled in a
360+
// custom area.
361+
message CustomLayerInfo {
362+
// Encapsulates areas related information on a `Route` or on a `RouteLeg`.
363+
message AreaInfo {
364+
// ID of an area inside a customer provided dataset. An area represents a
365+
// collection of polygons on the map that are of concern to the customer.
366+
// For example, the customer may be interested in knowing whether a
367+
// returned route is traveling through multiple busy city blocks during
368+
// a predefined period of time. An area ID is unique within a single
369+
// dataset uploaded by a customer. That is, a (customer_id, dataset_id,
370+
// area_id) triplet should uniquely identify a set of polygons on the map
371+
// that "activates" following a common schedule.
372+
string area_id = 1;
373+
374+
// Total distance traveled in the area (in meters).
375+
float distance_in_area_meters = 2;
376+
377+
// Total time spent in the area.
378+
google.protobuf.Duration duration_in_area = 3;
379+
}
380+
381+
// Encapsulates information about areas in the custom layer on the Route.
382+
// This field is only populated if a route travels through areas in the
383+
// custom layer.
384+
repeated AreaInfo area_info = 1;
385+
}

google/maps/routes/v1/route_matrix_element.proto

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2021 Google LLC
1+
// Copyright 2022 Google LLC
22
//
33
// Licensed under the Apache License, Version 2.0 (the "License");
44
// you may not use this file except in compliance with the License.

0 commit comments

Comments
 (0)