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+ }
0 commit comments