Method: geocode.location.geocodeLocation
Zadbaj o dobrą organizację dzięki kolekcji
Zapisuj i kategoryzuj treści zgodnie ze swoimi preferencjami.
Ta metoda wykonuje geokodowanie lokalizacji, które mapuje obiekt LatLng na adres. Zawiera też uporządkowane informacje o adresie.
Żądanie HTTP
GET https://geocode.googleapis.com/v4beta/geocode/location
Adres URL używa składni transkodowania gRPC.
Parametry zapytania
Parametry |
languageCode |
string
Opcjonalnie. Język, w którym mają być zwracane wyniki.
|
regionCode |
string
Opcjonalnie. Kod regionu. Kod regionu określony jako dwuznakowa wartość ccTLD („domena najwyższego poziomu”). Ten parametr wpływa na wyniki na podstawie obowiązujących przepisów.
|
types[] |
string
Opcjonalnie. Zestaw tagów typu, które ograniczają wyniki. Wyniki, które nie mają żadnego z określonych typów, zostaną usunięte. Pełną listę możliwych wartości znajdziesz w tabelach A i B na stronie https://developers.google.com/maps/documentation/places/web-service/place-types.
|
granularity[] |
enum (GeocodeResult.Granularity )
Opcjonalnie. Filtr zawierający co najmniej 1 wartość wyliczeniową określającą szczegółowość lokalizacji.
|
Parametr unii location_input . Lokalizacja do geokodowania. location_input może mieć tylko jedną z tych wartości: |
locationQuery |
string
Lokalizacja w formacie „lat,lng”. Na przykład „64.7611872,-18.4705364”.
|
location |
object (LatLng )
Lokalizacja w formacie strukturalnym.
|
Treść żądania
Treść żądania musi być pusta.
Treść odpowiedzi
W przypadku powodzenia treść odpowiedzi obejmuje wystąpienie elementu GeocodeLocationResponse
.
Zakresy autoryzacji
Wymaga jednego z tych zakresów OAuth:
https://www.googleapis.com/auth/cloud-platform
https://www.googleapis.com/auth/maps-platform.geocode
https://www.googleapis.com/auth/maps-platform.geocode.location
O ile nie stwierdzono inaczej, treść tej strony jest objęta licencją Creative Commons – uznanie autorstwa 4.0, a fragmenty kodu są dostępne na licencji Apache 2.0. Szczegółowe informacje na ten temat zawierają zasady dotyczące witryny Google Developers. Java jest zastrzeżonym znakiem towarowym firmy Oracle i jej podmiotów stowarzyszonych.
Ostatnia aktualizacja: 2025-08-31 UTC.
[null,null,["Ostatnia aktualizacja: 2025-08-31 UTC."],[],[],null,["# Method: geocode.location.geocodeLocation\n\n- [HTTP request](#body.HTTP_TEMPLATE)\n- [Query parameters](#body.QUERY_PARAMETERS)\n- [Request body](#body.request_body)\n- [Response body](#body.response_body)\n- [Authorization scopes](#body.aspect)\n\nThis method performs a location geocode, which maps a LatLng to an address. It also provides structured information about the address.\n\n### HTTP request\n\n`GET https://geocode.googleapis.com/v4beta/geocode/location`\n\nThe URL uses [gRPC Transcoding](https://google.aip.dev/127) syntax.\n\n### Query parameters\n\n| Parameters ||\n|-----------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `languageCode` | `string` Optional. Language in which the results should be returned. |\n| `regionCode` | `string` Optional. Region code. The region code, specified as a ccTLD (\"top-level domain\") two-character value. The parameter affects results based on applicable law. |\n| `types[]` | `string` Optional. A set of type tags to restrict the results. Results that do not have any of the specified types are removed. For the complete list of possible values, see Table A and Table B at \u003chttps://developers.google.com/maps/documentation/places/web-service/place-types\u003e. |\n| `granularity[]` | `enum (`[GeocodeResult.Granularity](/maps/documentation/geocoding/reference/rest/v4beta/GeocodeResult.Granularity)`)` Optional. A filter of one or more location granularity enums. |\n| Union parameter `location_input`. The location to geocode. `location_input` can be only one of the following: ||\n| `locationQuery` | `string` The location in the format of \"lat,lng\" string. For example, \"64.7611872,-18.4705364\". |\n| `location` | `object (`[LatLng](/maps/documentation/geocoding/reference/rest/Shared.Types/LatLng)`)` The location in the structured format. |\n\n### Request body\n\nThe request body must be empty.\n\n### Response body\n\nIf successful, the response body contains an instance of [GeocodeLocationResponse](/maps/documentation/geocoding/reference/rest/v4beta/GeocodeLocationResponse).\n\n### Authorization scopes\n\nRequires one of the following OAuth scopes:\n\n- `https://www.googleapis.com/auth/cloud-platform`\n- `\n https://www.googleapis.com/auth/maps-platform.geocode`\n- `\n https://www.googleapis.com/auth/maps-platform.geocode.location`"]]