@google-cloud/geocode 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,279 @@
1
+ // Copyright 2026 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
+
15
+ syntax = "proto3";
16
+
17
+ package google.maps.geocode.v4;
18
+
19
+ import "google/api/annotations.proto";
20
+ import "google/api/client.proto";
21
+ import "google/api/field_behavior.proto";
22
+ import "google/geo/type/viewport.proto";
23
+ import "google/type/latlng.proto";
24
+ import "google/type/localized_text.proto";
25
+ import "google/type/postal_address.proto";
26
+
27
+ option csharp_namespace = "Google.Maps.Geocode.V4";
28
+ option go_package = "cloud.google.com/go/maps/geocode/apiv4/geocodepb;geocodepb";
29
+ option java_multiple_files = true;
30
+ option java_outer_classname = "GeocodeServiceProto";
31
+ option java_package = "com.google.maps.geocode.v4";
32
+ option objc_class_prefix = "GMPG";
33
+ option php_namespace = "Google\\Maps\\Geocode\\V4";
34
+ option ruby_package = "Google::Maps::Geocode::V4";
35
+
36
+ // A service for performing geocoding.
37
+ service GeocodeService {
38
+ option (google.api.default_host) = "geocoding-backend.googleapis.com";
39
+ option (google.api.oauth_scopes) =
40
+ "https://www.googleapis.com/auth/cloud-platform,"
41
+ "https://www.googleapis.com/auth/maps-platform.geocode,"
42
+ "https://www.googleapis.com/auth/maps-platform.geocode.address,"
43
+ "https://www.googleapis.com/auth/maps-platform.geocode.location,"
44
+ "https://www.googleapis.com/auth/maps-platform.geocode.place";
45
+
46
+ // This method performs an address geocode, which maps an address to a
47
+ // LatLng. It also provides structured information about the address.
48
+ rpc GeocodeAddress(GeocodeAddressRequest) returns (GeocodeAddressResponse) {
49
+ option (google.api.http) = {
50
+ get: "/v4/geocode/address"
51
+ additional_bindings { get: "/v4/geocode/address/{address_query}" }
52
+ };
53
+ }
54
+
55
+ // This method performs a location geocode, which maps a LatLng to an
56
+ // address. It also provides structured information about the address.
57
+ rpc GeocodeLocation(GeocodeLocationRequest)
58
+ returns (GeocodeLocationResponse) {
59
+ option (google.api.http) = {
60
+ get: "/v4/geocode/location"
61
+ additional_bindings { get: "/v4/geocode/location/{location_query}" }
62
+ };
63
+ }
64
+
65
+ // This method performs a geocode lookup using a place ID.
66
+ rpc GeocodePlace(GeocodePlaceRequest) returns (GeocodeResult) {
67
+ option (google.api.http) = {
68
+ get: "/v4/geocode/{place=places/*}"
69
+ };
70
+ }
71
+ }
72
+
73
+ // Request message for GeocodeService.GeocodeAddress.
74
+ message GeocodeAddressRequest {
75
+ // The region to search. This location serves as a bias which means results
76
+ // around the given location are preferred.
77
+ message LocationBias {
78
+ // Types of location bias.
79
+ oneof type {
80
+ // A rectangular box defined by northeast and southwest corner.
81
+ // `rectangle.high()` must be the northeast point of the rectangle
82
+ // viewport. `rectangle.low()` must be the southwest point of the
83
+ // rectangle viewport. `rectangle.low().latitude()` cannot be greater than
84
+ // `rectangle.high().latitude()`. This will result in an empty latitude
85
+ // range. A rectangle viewport cannot be wider than 180 degrees.
86
+ google.geo.type.Viewport rectangle = 1;
87
+ }
88
+ }
89
+
90
+ // The address to geocode.
91
+ oneof address_input {
92
+ // The unstructured address to geocode.
93
+ string address_query = 1;
94
+
95
+ // The structured address to geocode in postal address format.
96
+ google.type.PostalAddress address = 2;
97
+ }
98
+
99
+ // Optional. The region to search. This location serves as a bias which means
100
+ // results around the given location are preferred.
101
+ LocationBias location_bias = 3 [(google.api.field_behavior) = OPTIONAL];
102
+
103
+ // Optional. Language in which the results should be returned.
104
+ string language_code = 4 [(google.api.field_behavior) = OPTIONAL];
105
+
106
+ // Optional. Region code. The region code, specified as a ccTLD ("top-level
107
+ // domain") two-character value. The parameter affects results based on
108
+ // applicable law. This parameter will also influence, but not fully restrict,
109
+ // results from the service.
110
+ string region_code = 5 [(google.api.field_behavior) = OPTIONAL];
111
+ }
112
+
113
+ // Request message for GeocodeService.GeocodeLocation.
114
+ message GeocodeLocationRequest {
115
+ // The location to geocode.
116
+ oneof location_input {
117
+ // The location in the format of "lat,lng" string. For example,
118
+ // "64.7611872,-18.4705364".
119
+ string location_query = 1;
120
+
121
+ // The location in the structured format.
122
+ google.type.LatLng location = 2;
123
+ }
124
+
125
+ // Optional. Language in which the results should be returned.
126
+ string language_code = 3 [(google.api.field_behavior) = OPTIONAL];
127
+
128
+ // Optional. Region code. The region code, specified as a ccTLD ("top-level
129
+ // domain") two-character value. The parameter affects results based on
130
+ // applicable law.
131
+ string region_code = 4 [(google.api.field_behavior) = OPTIONAL];
132
+
133
+ // Optional. A set of type tags to restrict the results. Results that do not
134
+ // have any of the specified types are removed.
135
+ //
136
+ // For the complete list of possible values, see Table A and Table B at
137
+ // https://developers.google.com/maps/documentation/places/web-service/place-types.
138
+ repeated string types = 5 [(google.api.field_behavior) = OPTIONAL];
139
+
140
+ // Optional. A filter of one or more location granularity enums.
141
+ repeated GeocodeResult.Granularity granularity = 6
142
+ [(google.api.field_behavior) = OPTIONAL];
143
+ }
144
+
145
+ // Request message for GeocodeService.GeocodePlace.
146
+ message GeocodePlaceRequest {
147
+ // Required. Place identifier to geocode in the format of places/{place}.
148
+ string place = 1 [(google.api.field_behavior) = REQUIRED];
149
+
150
+ // Optional. Language in which the results should be returned.
151
+ string language_code = 2 [(google.api.field_behavior) = OPTIONAL];
152
+
153
+ // Optional. Region code. The region code, specified as a ccTLD ("top-level
154
+ // domain") two-character value. The parameter affects results based on
155
+ // applicable law.
156
+ string region_code = 3 [(google.api.field_behavior) = OPTIONAL];
157
+ }
158
+
159
+ // Plus code (http://plus.codes) is a location reference with two formats:
160
+ // global code defining a 14mx14m (1/8000th of a degree) or smaller rectangle,
161
+ // and compound code, replacing the prefix with a reference location.
162
+ message PlusCode {
163
+ // Place's global (full) code, such as "9FWM33GV+HQ", representing an
164
+ // 1/8000 by 1/8000 degree area (~14 by 14 meters).
165
+ string global_code = 1;
166
+
167
+ // Place's compound code, such as "33GV+HQ, Ramberg, Norway", containing
168
+ // the suffix of the global code and replacing the prefix with a formatted
169
+ // name of a reference entity.
170
+ string compound_code = 2;
171
+ }
172
+
173
+ // A geocode result contains geographic information about a place.
174
+ message GeocodeResult {
175
+ // The structured components that form the formatted address, if this
176
+ // information is available.
177
+ message AddressComponent {
178
+ // The full text description or name of the address component. For example,
179
+ // an address component for the country Australia may have a long name of
180
+ // "Australia".
181
+ string long_text = 1;
182
+
183
+ // An abbreviated textual name for the address component, if available. For
184
+ // example, an address component for the country of Australia may have a
185
+ // short name of "AU".
186
+ string short_text = 2;
187
+
188
+ // An array indicating the type(s) of the address component.
189
+ //
190
+ // See
191
+ // https://developers.google.com/maps/documentation/geocoding/requests-geocoding#Types
192
+ // for more details.
193
+ repeated string types = 3;
194
+
195
+ // The language used to format this component, in CLDR notation.
196
+ string language_code = 4;
197
+ }
198
+
199
+ // The granularity of the location.
200
+ enum Granularity {
201
+ // Do not use.
202
+ GRANULARITY_UNSPECIFIED = 0;
203
+
204
+ // The non-interpolated location of an actual plot of land corresponding
205
+ // to the matched address.
206
+ ROOFTOP = 1;
207
+
208
+ // Interpolated from a range of street numbers. For example, if we know
209
+ // that a segment of Amphitheatre Pkwy contains numbers 1600 - 1699, then
210
+ // 1650 might be placed halfway between its endpoints.
211
+ RANGE_INTERPOLATED = 2;
212
+
213
+ // The geometric center of a feature for which we have polygonal data.
214
+ GEOMETRIC_CENTER = 3;
215
+
216
+ // Everything else.
217
+ APPROXIMATE = 4;
218
+ }
219
+
220
+ // This Place's resource name, in `places/{placeId}` format. Can be used to
221
+ // look up the Place.
222
+ string place = 1;
223
+
224
+ // The unique identifier of a place.
225
+ string place_id = 2;
226
+
227
+ // The latlng of this address.
228
+ google.type.LatLng location = 3;
229
+
230
+ // The granularity of the location.
231
+ Granularity granularity = 4;
232
+
233
+ // A viewport suitable for displaying the geocode result.
234
+ google.geo.type.Viewport viewport = 5;
235
+
236
+ // A bounding box for the address.
237
+ google.geo.type.Viewport bounds = 6;
238
+
239
+ // The one line formatted address.
240
+ string formatted_address = 7;
241
+
242
+ // The address in postal address format.
243
+ google.type.PostalAddress postal_address = 8;
244
+
245
+ // Repeated components for each locality level.
246
+ repeated AddressComponent address_components = 9;
247
+
248
+ // Complete list of localities contained in the postal code.
249
+ //
250
+ // This is only populated when the result is of type "postal_code".
251
+ repeated google.type.LocalizedText postal_code_localities = 11;
252
+
253
+ // A set of type tags for this result. For
254
+ // example, "political" and "administrative_area".
255
+ //
256
+ // For the complete list of possible values, see Table A and Table B at
257
+ // https://developers.google.com/maps/documentation/places/web-service/place-types.
258
+ repeated string types = 12;
259
+
260
+ // Plus code of the location in this geocode.
261
+ PlusCode plus_code = 13;
262
+ }
263
+
264
+ // Response message for
265
+ // [GeocodeService.GeocodeAddress][google.maps.geocode.v4.GeocodeService.GeocodeAddress].
266
+ message GeocodeAddressResponse {
267
+ // The geocoding result.
268
+ repeated GeocodeResult results = 1;
269
+ }
270
+
271
+ // Response message for
272
+ // [GeocodeService.GeocodeLocation][google.maps.geocode.v4.GeocodeService.GeocodeLocation].
273
+ message GeocodeLocationResponse {
274
+ // The geocoding result.
275
+ repeated GeocodeResult results = 1;
276
+
277
+ // Plus code of the location in the request.
278
+ PlusCode plus_code = 2;
279
+ }