

翻訳は機械翻訳により提供されています。提供された翻訳内容と英語版の間で齟齬、不一致または矛盾がある場合、英語版が優先します。

# 特定の言語でジオコーディングする方法
<a name="how-to-geocode-specific-language"></a>

この機能を使用すると、BCP47 準拠のコードから任意のレスポンス言語を選択できます。名前バリアントに基づいてクエリ言語を検出し、一致しないトークンやあいまいなケースに優先言語を使用します。リクエストされた言語がない場合、**Places** API はその国の公式言語で結果を提供しますが、リージョンの言語が異なる場合は、そのリージョンの言語を優先します。フォールバックとして、リクエストされた言語で住所の要素が使用できない場合は、**Places** API デフォルトの言語で住所を返します。

## 想定されるユースケース
<a name="potential-use-geocode-language"></a>

想定されるユースケースの 1 つは、クエリや結果をローカライズする場合です。

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

### 特定の言語で結果を取得する
<a name="geocode-language-result"></a>

------
#### [ 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"
```

------

### 特定の言語でクエリを実行する
<a name="geocode-language-query"></a>

------
#### [ 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 "पटना, बिहार, भारत"
```

------

### 特定の言語のクエリと結果
<a name="geocode-language-query-result"></a>

------
#### [ 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"
```

------