

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

# 正しい結果を得るためにジオコードを取り消す方法
<a name="reverse-geocode-filter-right-result"></a>

このガイドでは、リバースジオコーディングの結果を絞り込み、返されるデータが特定のビジネスニーズと密接に一致するようにする方法を説明します。フィルターを使用すると、ユーザーは結果を絞り込んで、住所ポイント、通り、地域などのタイプをより正確に一致させることができます。

## 想定されるユースケース
<a name="reverse-geocode-potential-use"></a>
+ **特定のニーズに合わせて結果を制限する:** フィルターを使用して、ビジネス要件に基づいて、正確な住所やより広範な地域データなど、最も関連性の高い情報のみを取得します。

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

### ポイントアドレスのフィルター
<a name="reverse-geocode-point-address"></a>

`PointAddress` をフィルタリングすることにより、特定の住所を取得して場所の精度を高めることができます。

------
#### [ Sample Request ]

```
{
    "QueryPosition": [
        -97.721, 30.404
    ],
    "Filter": {
        "IncludePlaceTypes": [
            "PointAddress"
        ]
    }
}
```

------
#### [ Sample Response ]

```
{
    "ResultItems": [
        {
            "PlaceId": "<Redacted>",
            "PlaceType": "PointAddress",
            "Title": "11721 Domain Blvd, Austin, TX 78758-0051, United States",
            "Address": {
                "Label": "11721 Domain Blvd, Austin, TX 78758-0051, United States",
                "Country": {
                    "Code2": "US",
                    "Code3": "USA",
                    "Name": "United States"
                },
                "Region": {
                    "Code": "TX",
                    "Name": "Texas"
                },
                "SubRegion": {
                    "Name": "Travis"
                },
                "Locality": "Austin",
                "District": "North Burnet",
                "PostalCode": "78758-0051",
                "Street": "Domain Blvd",
                "StreetComponents": [
                    {
                        "BaseName": "Domain",
                        "Type": "Blvd",
                        "TypePlacement": "AfterBaseName",
                        "TypeSeparator": " ",
                        "Language": "en"
                    }
                ],
                "AddressNumber": "11721"
            },
            "Position": [
                -97.72087,
                30.404
            ],
            "Distance": 5,
            "MapView": [
                -97.72219,
                30.40273,
                -97.72057,
                30.40649
            ]
        }
    ]
}
```

------
#### [ 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": [
        -97.721,  30.404
    ],
    "Filter": {
        "IncludePlaceTypes": [
            "PointAddress"
        ]
    }'
```

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

```
aws geo-places reverse-geocode --key ${YourKey} --query-position -97.721 30.404 --filter '{"IncludePlaceTypes": ["PointAddress"]}'
```

------

### 番地のフィルター
<a name="reverse-geocode-street"></a>

`Street` をフィルタリングすることにより、API は特定の住所番号のない通りレベルのデータを返します。

------
#### [ Sample Request ]

```
{
    "QueryPosition": [
        -97.721, 30.404
    ],
    "Filter": {
        "IncludePlaceTypes": [
            "Street"
        ]
    }
}
```

------
#### [ Sample Response ]

```
{
    "ResultItems": [
        {
            "PlaceId": "<Redacted>",
            "PlaceType": "Street",
            "Title": "Domain Blvd, Austin, TX 78758, United States",
            "Address": {
                "Label": "Domain Blvd, Austin, TX 78758, United States",
                "Country": {
                    "Code2": "US",
                    "Code3": "USA",
                    "Name": "United States"
                },
                "Region": {
                    "Code": "TX",
                    "Name": "Texas"
                },
                "SubRegion": {
                    "Name": "Travis"
                },
                "Locality": "Austin",
                "District": "North Burnet",
                "PostalCode": "78758",
                "Street": "Domain Blvd",
                "StreetComponents": [
                    {
                        "BaseName": "Domain",
                        "Type": "Blvd",
                        "TypePlacement": "AfterBaseName",
                        "TypeSeparator": " ",
                        "Language": "en"
                    }
                ]
            },
            "Position": [
                -97.72103,
                30.40399
            ],
            "Distance": 3,
            "MapView": [
                -97.72219,
                30.40273,
                -97.72057,
                30.40649
            ]
        }
    ]
}
```

------
#### [ 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": [
        -97.721,  30.404
    ],
    "Filter": {
        "IncludePlaceTypes": [
            "Street"
        ]
    }'
```

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

```
aws geo-places reverse-geocode --key ${YourKey} --query-position -97.721 30.404 --filter '{"IncludePlaceTypes": ["Street"]}'
```

------

### 市区町村性のフィルター
<a name="reverse-geocode-locality"></a>

`Locality` をフィルタリングすることにより、都市名を含むより広範な位置データを取得できます。

------
#### [ Sample Request ]

```
{
    "QueryPosition": [
        -97.721, 30.404
    ],
    "Filter": {
        "IncludePlaceTypes": [
            "Locality"
        ]
    }
}
```

------
#### [ Sample Response ]

```
{
    "ResultItems": [
        {
            "PlaceId": "<Redacted>",
            "PlaceType": "Locality",
            "Title": "Austin, TX, United States",
            "Address": {
                "Label": "Austin, TX, United States",
                "Country": {
                    "Code2": "US",
                    "Code3": "USA",
                    "Name": "United States"
                },
                "Region": {
                    "Code": "TX",
                    "Name": "Texas"
                },
                "SubRegion": {
                    "Name": "Travis"
                },
                "Locality": "Austin",
                "PostalCode": "78701"
            },
            "Position": [
                -97.74299,
                30.26759
            ],
            "Distance": 0,
            "MapView": [
                -98.06484,
                30.06592,
                -97.55914,
                30.51965
            ]
        }
    ]
}
```

------
#### [ 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": [
        -97.721,  30.404
    ],
    "Filter": {
        "IncludePlaceTypes": [
            "Locality"
        ]
    }'
```

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

```
aws geo-places reverse-geocode --key ${YourKey} --query-position -97.721 30.404 --filter '{"IncludePlaceTypes": ["Locality"]}'
```

------