翻訳は機械翻訳により提供されています。提供された翻訳内容と英語版の間で齟齬、不一致または矛盾がある場合、英語版が優先します。
国内の近くの を検索する方法
SearchNearby API を使用すると、特定の国内の近くの場所を検索できます。API を使用するには、QueryPosition を指定する必要があります。これは次のようになります。
-
デバイスの位置
-
IP ベースの位置
-
マップのビューポート中心
または、ユーザーは都市名または場所を指定でき、アプリケーションはその場所の地理的座標に基づいて結果をバイアスできます。
潜在的なユースケース
-
国内のビジネスを探索する
-
国内の近くの B2B 顧客を検索する
-
国内の観光地を探索する
例
次の例は、指定された座標に近いカナダ内のコースを検索する方法を示しています。
- Sample request
-
このリクエストは、指定された場所に近いカナダのコースを検索します。
{
"QueryPosition": [
-122.741803,
49.002478
],
"Filter" : {
"IncludeCategories": ["golf_course"],
"IncludeCountries": ["CAN"]
}
}
- Sample response
-
{
"ResultItems": [
{
"PlaceId": "<Redacted>",
"PlaceType": "PointOfInterest",
"Title": "Peace Portal Golf Course",
"Address": {
"Label": "Peace Portal Golf Course, 16900 * Ave, Surrey, BC V*Z *P*, Canada",
"Country": {
"Code2": "CA",
"Code3": "CAN",
"Name": "Canada"
},
"Region": {
"Code": "BC",
"Name": "British Columbia"
},
"SubRegion": {
"Name": "Metro Vancouver"
},
"Locality": "Surrey",
"District": "South Surrey",
"PostalCode": "V*Z *P*",
"Street": "* Ave",
"StreetComponents": [
{
"BaseName": "4",
"Type": "Ave",
"TypePlacement": "AfterBaseName",
"TypeSeparator": " ",
"Language": "en"
}
],
"AddressNumber": "16900"
},
"Position": [
-122.75086,
49.00921
],
"Distance": 998,
"Categories": [
{
"Id": "golf_course",
"Name": "Golf Course",
"LocalizedName": "Golf Course",
"Primary": true
}
],
"Contacts": {
"Phones": [
{
"Value": "+16045384818" }
],
"Websites": [
{
"Value": "http://www.peaceportalgolf.com"
}
]
},
"AccessPoints": [
{
"Position": [
-122.75087,
49.00935
]
}
]
}
]
}
- cURL
-
curl --request POST \
--url 'https://places.geo.eu-central-1.amazonaws.com/v2/search-nearby?key=Your_Key' \
--header 'Content-Type: application/json' \
--data '{
"QueryPosition": [
-122.741803,
49.002478
],
"Filter" : {
"IncludeCategories": ["golf_course"],
"IncludeCountries": ["CAN"]
}
}'
- AWS CLI
-
aws geo-places search-nearby --key ${YourKey} \
--query-position -122.741803 49.002478 \
--filter '{"IncludeCategories": ["golf_course"], "IncludeCountries": ["CAN"]}'