Le traduzioni sono generate tramite traduzione automatica. In caso di conflitto tra il contenuto di una traduzione e la versione originale in Inglese, quest'ultima prevarrà.
Come geocodificare in una lingua specifica
Questa funzionalità consente la selezione di un linguaggio di risposta preferito tra i codici BCP47 conformi. Rileva il linguaggio di interrogazione in base alle varianti dei nomi e utilizza il linguaggio preferito per token senza pari e casi ambigui. Se non esiste una lingua richiesta, l'API Places fornisce i risultati nella lingua ufficiale del paese, ma dà priorità alla lingua regionale nelle regioni in cui è diversa. Come strategia alternativa, se alcuni elementi dell'indirizzo non sono disponibili nella lingua richiesta, Places APIs restituisce gli indirizzi nella lingua predefinita.
Casi d'uso potenziali
Un potenziale caso d'uso è quello di localizzare la query e/o il risultato.
Esempi
- Sample request
-
{
"QueryText":"Patna, Bihar, Bharat",
"Language": "HI"
}
- Sample response
-
{
"ResultItems": [
{
"PlaceId": "<Redacted>",
"PlaceType": "Locality",
"Title": "पटना, बिहार, भारत",
"Address": {
"Label": "पटना, बिहार, भारत",
"Country": {
"Code2": "IN",
"Code3": "IND",
"Name": "भारत"
},
"Region": {
"Code": "BR",
"Name": "बिहार"
},
"SubRegion": {
"Name": "पटना"
},
"Locality": "पटना",
"PostalCode": "800001"
},
"Position": [
85.13752,
25.60134
],
"MapView": [
85.03222,
25.55157,
85.27107,
25.65917
],
"MatchScores": {
"Overall": 1,
"Components": {
"Address": {
"Country": 1,
"Region": 1,
"Locality": 1
}
}
}
}
]
}
- cURL
-
curl --request POST \
--url 'https://places.geo.eu-central-1.amazonaws.com/v2/geocode?key=Your_Key' \
--header 'Content-Type: application/json' \
--data '{
"QueryText":"Patna, Bihar, Bharat",
"Language": "HI"
}'
- AWS CLI
-
aws geo-places geocode --key ${YourKey} --query-text "पटना, बिहार, भारत" --language "HI"
- Sample request
-
{
"QueryText":"पटना, बिहार, भारत"
}
- Sample response
-
{
"ResultItems": [
{
"PlaceId": "<Redacted>",
"PlaceType": "Locality",
"Title": "Patana, Bihar, Bharat",
"Address": {
"Label": "Patana, Bihar, Bharat",
"Country": {
"Code2": "IN",
"Code3": "IND",
"Name": "Bharat"
},
"Region": {
"Code": "BR",
"Name": "Bihar"
},
"SubRegion": {
"Name": "Patana"
},
"Locality": "Patana",
"PostalCode": "800001"
},
"Position": [
85.13752,
25.60134
],
"MapView": [
85.03222,
25.55157,
85.27107,
25.65917
],
"MatchScores": {
"Overall": 1,
"Components": {
"Address": {
"Country": 1,
"Region": 1,
"Locality": 1
}
}
}
}
]
}
- cURL
-
curl --request POST \
--url 'https://places.geo.eu-central-1.amazonaws.com/v2/geocode?key=Your_Key' \
--header 'Content-Type: application/json' \
--data '{
"QueryText":"पटना, बिहार, भारत"
}'
- AWS CLI
-
aws geo-places geocode --key ${YourKey} --query-text "पटना, बिहार, भारत"
- Sample request
-
{
"QueryText":"पटना, बिहार, भारत",
"Language": "HI"
}
- Sample response
-
{
"ResultItems": [
{
"PlaceId": "<Redacted>",
"PlaceType": "Locality",
"Title": "पटना, बिहार, भारत",
"Address": {
"Label": "पटना, बिहार, भारत",
"Country": {
"Code2": "IN",
"Code3": "IND",
"Name": "भारत"
},
"Region": {
"Code": "BR",
"Name": "बिहार"
},
"SubRegion": {
"Name": "पटना"
},
"Locality": "पटना",
"PostalCode": "800001"
},
"Position": [
85.13752,
25.60134
],
"MapView": [
85.03222,
25.55157,
85.27107,
25.65917
],
"MatchScores": {
"Overall": 1,
"Components": {
"Address": {
"Country": 1,
"Region": 1,
"Locality": 1
}
}
}
}
]
}
- cURL
-
curl --request POST \
--url 'https://places.geo.eu-central-1.amazonaws.com/v2/geocode?key=Your_Key' \
--header 'Content-Type: application/json' \
--data '{
"QueryText":"पटना, बिहार, भारत",
"Language": "HI"
}'
- AWS CLI
-
aws geo-places geocode --key ${YourKey} --query-text "पटना, बिहार, भारत" --language "HI"