Method: geocode.location.geocodeLocation
Mantieni tutto organizzato con le raccolte
Salva e classifica i contenuti in base alle tue preferenze.
Questo metodo esegue una geocodifica della posizione, che mappa un LatLng a un indirizzo. Fornisce anche informazioni strutturate sull'indirizzo.
Richiesta HTTP
GET https://geocode.googleapis.com/v4beta/geocode/location
L'URL utilizza la sintassi di transcodifica gRPC.
Parametri di query
Parametri |
languageCode |
string
(Facoltativo) La lingua in cui devono essere restituiti i risultati.
|
regionCode |
string
(Facoltativo) Codice regione. Il codice regione, specificato come valore di due caratteri ccTLD ("dominio di primo livello"). Il parametro influisce sui risultati in base alla legge vigente.
|
types[] |
string
(Facoltativo) Un insieme di tag di tipo per limitare i risultati. I risultati che non hanno nessuno dei tipi specificati vengono rimossi. Per l'elenco completo dei valori possibili, consulta la tabella A e la tabella B all'indirizzo https://developers.google.com/maps/documentation/places/web-service/place-types.
|
granularity[] |
enum (GeocodeResult.Granularity )
(Facoltativo) Un filtro di una o più enumerazioni di granularità della posizione.
|
Parametro di unione location_input . La posizione da geocodificare. location_input può essere solo uno dei seguenti: |
locationQuery |
string
La posizione nel formato della stringa "lat,lng". Ad esempio, "64.7611872,-18.4705364".
|
location |
object (LatLng )
La posizione nel formato strutturato.
|
Corpo della richiesta
Il corpo della richiesta deve essere vuoto.
Corpo della risposta
In caso di esito positivo, il corpo della risposta contiene un'istanza di GeocodeLocationResponse
.
Ambiti di autorizzazione
Richiede uno dei seguenti ambiti 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
Salvo quando diversamente specificato, i contenuti di questa pagina sono concessi in base alla licenza Creative Commons Attribution 4.0, mentre gli esempi di codice sono concessi in base alla licenza Apache 2.0. Per ulteriori dettagli, consulta le norme del sito di Google Developers. Java è un marchio registrato di Oracle e/o delle sue consociate.
Ultimo aggiornamento 2025-08-31 UTC.
[null,null,["Ultimo aggiornamento 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`"]]