xref: /aosp_15_r20/external/googleapis/google/maps/addressvalidation/v1/geocode.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.addressvalidation.v1;
18
19import "google/geo/type/viewport.proto";
20import "google/type/latlng.proto";
21
22option cc_enable_arenas = true;
23option csharp_namespace = "Google.Maps.AddressValidation.V1";
24option go_package = "cloud.google.com/go/maps/addressvalidation/apiv1/addressvalidationpb;addressvalidationpb";
25option java_multiple_files = true;
26option java_outer_classname = "GeocodeProto";
27option java_package = "com.google.maps.addressvalidation.v1";
28option objc_class_prefix = "GMPAVV1";
29option php_namespace = "Google\\Maps\\AddressValidation\\V1";
30option ruby_package = "Google::Maps::AddressValidation::V1";
31
32// Contains information about the place the input was geocoded to.
33message Geocode {
34  // The geocoded location of the input.
35  //
36  // Using place IDs is preferred over using addresses,
37  // latitude/longitude coordinates, or plus codes. Using coordinates when
38  // routing or calculating driving directions will always result in the point
39  // being snapped to the road nearest to those coordinates. This may not be a
40  // road that will quickly or safely lead to the destination and may not be
41  // near an access point to the property. Additionally, when a location is
42  // reverse geocoded, there is no guarantee that the returned address will
43  // match the original.
44  google.type.LatLng location = 1;
45
46  // The plus code corresponding to the `location`.
47  PlusCode plus_code = 2;
48
49  // The bounds of the geocoded place.
50  google.geo.type.Viewport bounds = 4;
51
52  // The size of the geocoded place, in meters. This is another measure of the
53  // coarseness of the geocoded location, but in physical size rather than in
54  // semantic meaning.
55  float feature_size_meters = 5;
56
57  // The PlaceID of the place this input geocodes to.
58  //
59  // For more information about Place IDs see
60  // [here](https://developers.google.com/maps/documentation/places/web-service/place-id).
61  string place_id = 6;
62
63  // The type(s) of place that the input geocoded to. For example,
64  // `['locality', 'political']`. The full list of types can be found
65  // [here](https://developers.google.com/maps/documentation/geocoding/requests-geocoding#Types).
66  repeated string place_types = 7;
67}
68
69// Plus code (http://plus.codes) is a location reference with two formats:
70// global code defining a 14mx14m (1/8000th of a degree) or smaller rectangle,
71// and compound code, replacing the prefix with a reference location.
72message PlusCode {
73  // Place's global (full) code, such as "9FWM33GV+HQ", representing an
74  // 1/8000 by 1/8000 degree area (~14 by 14 meters).
75  string global_code = 1;
76
77  // Place's compound code, such as "33GV+HQ, Ramberg, Norway", containing
78  // the suffix of the global code and replacing the prefix with a formatted
79  // name of a reference entity.
80  string compound_code = 2;
81}
82