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