

本文為英文版的機器翻譯版本，如內容有任何歧義或不一致之處，概以英文版為準。

# 如何反轉特定語言的地理碼
<a name="how-to-reverse-geocode-specific-language"></a>

 此功能允許從 BCP47-compliant代碼中選擇偏好的回應語言。它會根據名稱變體偵測查詢語言，並針對不相符的字符和模棱兩可的案例使用偏好的語言。如果沒有請求的語言，**則 Places** API 會以官方國家/地區語言提供結果，但會優先考慮不同區域中的區域語言。作為備用策略，如果請求的語言中有任何地址元素無法使用，**則 Places** APIs會以預設語言傳回地址。

## 潛在的使用案例
<a name="potential-use-geocode-language"></a>

一個潛在的使用案例是將查詢和/或結果當地語系化。

## 範例
<a name="reverse-geocode-language-examples"></a>

### 取得特定語言的結果
<a name="reverse-geocode-language-result"></a>

------
#### [ Sample request ]

```
{
    "QueryPosition": [
                139.69172,
                35.6895
            ],
    "Language": "JA"
}
```

------
#### [ Sample response ]

```
{
    "ResultItems": [
        {
            "PlaceId": "<Redacted>",
            "PlaceType": "PointAddress",
            "Title": "2-8-1 Nishishinjuku, Shinjuku-ku, Tokyo 160-0023, Japan",
            "Address": {
                "Label": "2-8-1 Nishishinjuku, Shinjuku-ku, Tokyo 160-0023, Japan",
                "Country": {
                    "Code2": "JP",
                    "Code3": "JPN",
                    "Name": "Japan"
                },
                "Region": {
                    "Name": "Tokyo"
                },
                "SubRegion": {},
                "Locality": "Shinjuku-ku",
                "SubDistrict": "Nishishinjuku",
                "PostalCode": "160-0023",
                "Block": "2 Chome",
                "SubBlock": "8",
                "AddressNumber": "1"
            },
            "Position": [
                139.69171,
                35.68949
            ],
            "Distance": 1,
            "MapView": [
                139.69071,
                35.68861,
                139.69251,
                35.69048
            ],
            "AccessPoints": [
                {
                    "Position": [
                        139.69206,
                        35.68954
                    ]
                }
            ]
        }
    ]
}
```

------
#### [ cURL ]

```
curl --request POST \
  --url 'https://places.geo.eu-central-1.amazonaws.com/v2/reverse-geocode?key=Your_Key' \
  --header 'Content-Type: application/json' \
  --data '{
    "QueryPosition": [
                139.69172,
                35.6895
            ],
    "Language": "JA"
}'
```

------
#### [ AWS CLI ]

```
aws geo-places reverse-geocode --key ${YourKey} --query-position 139.69172 35.6895 --language "JA"
```

------