xref: /aosp_15_r20/external/googleapis/google/maps/fleetengine/v1/traffic.proto (revision d5c09012810ac0c9f33fe448fb6da8260d444cc9)
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
15syntax = "proto3";
16
17package maps.fleetengine.v1;
18
19option csharp_namespace = "Google.Maps.FleetEngine.V1";
20option go_package = "cloud.google.com/go/maps/fleetengine/apiv1/fleetenginepb;fleetenginepb";
21option java_multiple_files = true;
22option java_outer_classname = "TrafficProto";
23option java_package = "google.maps.fleetengine.v1";
24option objc_class_prefix = "CFE";
25
26// Traffic density indicator on a contiguous segment of a path. Given a path
27// with points P_0, P_1, ... , P_N (zero-based index), the SpeedReadingInterval
28// defines an interval and describes its traffic using the following categories.
29message SpeedReadingInterval {
30  // The classification of polyline speed based on traffic data.
31  enum Speed {
32    // Default value. This value is unused.
33    SPEED_UNSPECIFIED = 0;
34
35    // Normal speed, no slowdown is detected.
36    NORMAL = 1;
37
38    // Slowdown detected, but no traffic jam formed.
39    SLOW = 2;
40
41    // Traffic jam detected.
42    TRAFFIC_JAM = 3;
43  }
44
45  // The starting index of this interval in the path.
46  // In JSON, when the index is 0, the field will appear to be unpopulated.
47  int32 start_polyline_point_index = 1;
48
49  // The ending index of this interval in the path.
50  // In JSON, when the index is 0, the field will appear to be unpopulated.
51  int32 end_polyline_point_index = 2;
52
53  // Traffic speed in this interval.
54  Speed speed = 3;
55}
56
57// Traffic density along a Vehicle's path.
58message ConsumableTrafficPolyline {
59  // Traffic speed along the path from the previous waypoint to the current
60  // waypoint.
61  repeated SpeedReadingInterval speed_reading_interval = 1;
62
63  // The path the driver is taking from the previous waypoint to the current
64  // waypoint. This path has landmarks in it so clients can show traffic markers
65  // along the path (see `speed_reading_interval`).  Decoding is not yet
66  // supported.
67  string encoded_path_to_waypoint = 2;
68}
69