翻訳は機械翻訳により提供されています。提供された翻訳内容と英語版の間で齟齬、不一致または矛盾がある場合、英語版が優先します。
アドレスを検索する方法
SearchText API を使用すると、アドレスを検索できます。
SearchText API を使用する 1 つの方法は、エンドユーザーがアドレスとアプリケーションセットのバイアス位置を検索できるようにすることです。これらのバイアス位置は、デバイス位置、IP 位置、またはマップのビューポートの中心です。さらに、エンドユーザーは都市名または場所を指定でき、アプリケーションは地理的座標に基づいて結果をバイアスする可能性があります。
潜在的なユースケース
例
- Sample request
-
{
"QueryText":"1368 E 8 Ave Vancouver",
"BiasPosition":[
-123.18544,
49.24643
],
"MaxResults":1
}
- Sample response
-
{
"ResultItems": [
{
"PlaceId": "<Redacted>",
"PlaceType": "PointAddress",
"Title": "1368 E 8th Ave, Vancouver, BC V5N 1T2, Canada",
"Address": {
"Label": "1368 E 8th Ave, Vancouver, BC V5N 1T2, Canada",
"Country": {
"Code2": "CA",
"Code3": "CAN",
"Name": "Canada"
},
"Region": {
"Code": "BC",
"Name": "British Columbia"
},
"SubRegion": {
"Name": "Metro Vancouver"
},
"Locality": "Vancouver",
"District": "Grandview-Woodland",
"PostalCode": "V5N 1T2",
"Street": "E 8th Ave",
"StreetComponents": [
{
"BaseName": "8th",
"Type": "Ave",
"TypePlacement": "AfterBaseName",
"TypeSeparator": " ",
"Prefix": "E",
"Language": "en"
}
],
"AddressNumber": "1368"
},
"Position": [
-123.07612,
49.26306
],
"Distance": 8147,
"MapView": [
-123.07752,
49.26299,
-123.05661,
49.26334
]
}
]
}
- cURL
-
curl --request POST \
--url 'https://places.geo.eu-central-1.amazonaws.com/v2/search-text?key=Your_Key' \
--header 'Content-Type: application/json' \
--data '{
"QueryText": "1368 E 8 Ave Vancouver",
"BiasPosition": [
-123.18544,
49.24643
],
"MaxResults": 1
}'
- AWS CLI
-
aws geo-places search-text --key ${YourKey} --query-text "1368 E 8 Ave Vancouver" --bias-position -123.18544 49.24643 --max-results 1