범주 이름 또는 음식 유형을 사용하여 검색하는 방법 - Amazon Location Service

기계 번역으로 제공되는 번역입니다. 제공된 번역과 원본 영어의 내용이 상충하는 경우에는 영어 버전이 우선합니다.

범주 이름 또는 음식 유형을 사용하여 검색하는 방법

SearchText API를 사용하면 레스토랑, 학교 등과 같은 범주의 이름으로 검색할 수 있습니다. 음식 유형별로 검색할 수도 있습니다.

SearchText API를 사용하는 한 가지 방법은 최종 사용자가 이름(범주 및 음식 유형)과 애플리케이션 세트의 편향 위치를 기준으로 검색할 수 있도록 하는 것입니다. 이러한 바이어스 위치는 디바이스 위치, IP 위치 또는 맵의 뷰 포트 중심일 수 있습니다. 또한 최종 사용자는 도시 이름이나 위치를 제공할 수 있으며 애플리케이션은 지역 좌표에 따라 결과를 편향시킬 수 있습니다.

자세한 내용은 범주 필터음식 유형 필터 섹션을 참조하세요.

잠재적 사용 사례

  • 특정 POI를 검색하거나 이웃을 탐색하는 과정에서 특정 POI 또는 장소를 찾습니다.

  • 여행 계획을 위한 특정 여행지를 검색합니다.

  • 특정 음식에 서비스를 제공하는 레스토랑을 검색합니다.

예시

Sample request
{ "QueryText": "Nursing Home", "BiasPosition": [ -123.11336, 49.26038 ], }
Sample response
{ "ResultItems": [ { "PlaceId": "<Redacted>", "PlaceType": "PointOfInterest", "Title": "Diamond Geriatrics Inc", "Address": { "Label": "Diamond Geriatrics Inc, 288 W 8th Ave, Vancouver, BC V5Y 1N5, Canada", "Country": { "Code2": "CA", "Code3": "CAN", "Name": "Canada" }, "Region": { "Code": "BC", "Name": "British Columbia" }, "SubRegion": { "Name": "Metro Vancouver" }, "Locality": "Vancouver", "District": "Mt Pleasant", "PostalCode": "V5Y 1N5", "Street": "W 8th Ave", "StreetComponents": [ { "BaseName": "8th", "Type": "Ave", "TypePlacement": "AfterBaseName", "TypeSeparator": " ", "Prefix": "W", "Language": "en" } ], "AddressNumber": "288" }, "Position": [ -123.11061, 49.2636 ], "Distance": 410, "Categories": [ { "Id": "nursing_home", "Name": "Nursing Home", "LocalizedName": "Nursing Home", "Primary": true }, { "Id": "social_service", "Name": "Social Service", "LocalizedName": "Social Services", "Primary": false } ] }, { "PlaceId": "<Redacted>", "PlaceType": "PointOfInterest", "Title": "Para Med Home Health Care", "Address": { "Label": "Para Med Home Health Care, 601 W Broadway, Vancouver, BC V5Z 4C2, Canada", "Country": { "Code2": "CA", "Code3": "CAN", "Name": "Canada" }, "Region": { "Code": "BC", "Name": "British Columbia" }, "SubRegion": { "Name": "Metro Vancouver" }, "Locality": "Vancouver", "District": "Fairview", "PostalCode": "V5Z 4C2", "Street": "W Broadway", "StreetComponents": [ { "BaseName": "Broadway", "Prefix": "W", "Language": "en" } ], "AddressNumber": "601" }, "Position": [ -123.11772, 49.26343 ], "Distance": 464, "Categories": [ { "Id": "nursing_home", "Name": "Nursing Home", "LocalizedName": "Nursing Home", "Primary": true }, { "Id": "hospital_or_health_care_facility", "Name": "Hospital or Health Care Facility", "LocalizedName": "Hospital or Health Care Facility", "Primary": false } ] } ... ... ] }
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": "Nursing Home", "BiasPosition": [ -123.11336, 49.26038 ] }'
AWS CLI
aws geo-places search-text --key ${YourKey} --query-text "Nursing Home" --bias-position -123.11336 49.26038

에 대한 음식 유형을 지정QueryText하여 음식 유형별로 레스토랑을 선택합니다. 음식 유형별로 필터링하면 음식 유형별로 레스토랑을 인덱싱, 쿼리 및 표시할 수 있습니다.

Sample request
{ "QueryText": "Sushi", "BiasPosition": [ -123.11336, 49.26038 ] }
Sample response
{ "ResultItems": [ { "PlaceId": "<Redacted>", "PlaceType": "PointOfInterest", "Title": "Sushi Tomy", "Address": { "Label": "Sushi Tomy, 555 W 12th Ave, Vancouver, BC V5Z 3X7, Canada", "Country": { "Code2": "CA", "Code3": "CAN", "Name": "Canada" }, "Region": { "Code": "BC", "Name": "British Columbia" }, "SubRegion": { "Name": "Metro Vancouver" }, "Locality": "Vancouver", "District": "Fairview", "PostalCode": "V5Z 3X7", "Street": "W 12th Ave", "StreetComponents": [ { "BaseName": "12th", "Type": "Ave", "TypePlacement": "AfterBaseName", "TypeSeparator": " ", "Prefix": "W", "Language": "en" } ], "AddressNumber": "555" }, "Position": [ -123.11629, 49.26086 ], "Distance": 219, "Categories": [ { "Id": "deli", "Name": "Deli", "LocalizedName": "Deli", "Primary": true }, { "Id": "restaurant", "Name": "Restaurant", "LocalizedName": "Restaurant", "Primary": false }, { "Id": "casual_dining", "Name": "Casual Dining", "LocalizedName": "Casual Dining", "Primary": false } ], "FoodTypes": [ { "LocalizedName": "Japanese - Sushi", "Id": "japanese-sushi", "Primary": true }, { "LocalizedName": "Canadian", "Id": "canadian", "Primary": false }, { "LocalizedName": "Japanese", "Id": "japanese", "Primary": false } ] }, { "PlaceId": "<Redacted>" "PlaceType": "PointOfInterest", "Title": "Shiro Japanese Restaurant", "Address": { "Label": "Shiro Japanese Restaurant, 3096 Cambie St, Vancouver, BC V5Z 2V9, Canada", "Country": { "Code2": "CA", "Code3": "CAN", "Name": "Canada" }, "Region": { "Code": "BC", "Name": "British Columbia" }, "SubRegion": { "Name": "Metro Vancouver" }, "Locality": "Vancouver", "District": "Mt Pleasant", "PostalCode": "V5Z 2V9", "Street": "Cambie St", "StreetComponents": [ { "BaseName": "Cambie", "Type": "St", "TypePlacement": "AfterBaseName", "TypeSeparator": " ", "Language": "en" } ], "AddressNumber": "3096" }, "Position": [ -123.11461, 49.25797 ], "Distance": 283, "Categories": [ { "Id": "casual_dining", "Name": "Casual Dining", "LocalizedName": "Casual Dining", "Primary": true }, { "Id": "restaurant", "Name": "Restaurant", "LocalizedName": "Restaurant", "Primary": false } ], "FoodTypes": [ { "LocalizedName": "Japanese - Sushi", "Id": "japanese-sushi", "Primary": true }, { "LocalizedName": "Asian", "Id": "asian", "Primary": false }, { "LocalizedName": "Japanese", "Id": "japanese", "Primary": false } ] }, ... ... ] }
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": "Sushi", "BiasPosition": [ -123.11336, 49.26038 ] }'
AWS CLI
aws geo-places search-text --key ${YourKey} --query-text "Sushi" --bias-position -123.11336 49.26038