xref: /aosp_15_r20/external/googleapis/google/maps/routes/v1/polyline.proto (revision d5c09012810ac0c9f33fe448fb6da8260d444cc9)
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
15syntax = "proto3";
16
17package google.maps.routes.v1;
18
19import "google/protobuf/struct.proto";
20
21option cc_enable_arenas = true;
22option csharp_namespace = "Google.Maps.Routes.V1";
23option go_package = "cloud.google.com/go/maps/routes/apiv1/routespb;routespb";
24option java_multiple_files = true;
25option java_outer_classname = "PolylineProto";
26option java_package = "com.google.maps.routes.v1";
27option objc_class_prefix = "GMRS";
28option php_namespace = "Google\\Maps\\Routes\\V1";
29
30// Encapsulates an encoded polyline.
31message Polyline {
32  // Encapsulates the type of polyline. Defaults to encoded_polyline.
33  oneof polyline_type {
34    // The string encoding of the polyline using the [polyline encoding
35    // algorithm](https://developers.google.com/maps/documentation/utilities/polylinealgorithm)
36    string encoded_polyline = 1;
37
38    // Specifies a polyline using the [GeoJSON LineString
39    // format](https://tools.ietf.org/html/rfc7946#section-3.1.4)
40    google.protobuf.Struct geo_json_linestring = 2;
41  }
42}
43
44// A set of values that specify the quality of the polyline.
45enum PolylineQuality {
46  // No polyline quality preference specified. Defaults to `OVERVIEW`.
47  POLYLINE_QUALITY_UNSPECIFIED = 0;
48
49  // Specifies a high-quality polyline - which is composed using more points
50  // than `OVERVIEW`, at the cost of increased response size. Use this value
51  // when you need more precision.
52  HIGH_QUALITY = 1;
53
54  // Specifies an overview polyline - which is composed using a small number of
55  // points. Use this value when displaying an overview of the route. Using this
56  // option has a lower request latency compared to using the
57  // `HIGH_QUALITY` option.
58  OVERVIEW = 2;
59}
60
61// Specifies the preferred type of polyline to be returned.
62enum PolylineEncoding {
63  // No polyline type preference specified. Defaults to `ENCODED_POLYLINE`.
64  POLYLINE_ENCODING_UNSPECIFIED = 0;
65
66  // Specifies a polyline encoded using the [polyline encoding
67  // algorithm](https://developers.google.com/maps/documentation/utilities/polylinealgorithm).
68  ENCODED_POLYLINE = 1;
69
70  // Specifies a polyline using the [GeoJSON LineString
71  // format](https://tools.ietf.org/html/rfc7946#section-3.1.4)
72  GEO_JSON_LINESTRING = 2;
73}
74