사용자가 유사한 결과 간에 모호하지 않게 하는 방법 - Amazon Location Service

사용자가 유사한 결과 간에 모호하지 않게 하는 방법

Suggest API를 사용하면 결과 위치 또는 범주에 대한 쿼리를 생성할 수 있습니다. 결과는 일치 가능성이 높은 것에서 낮은 것으로 정렬됩니다. 각 결과에 대한 정보가 제공되므로 특히 제목 및 레이블 필드와 관련하여 올바른 일치 항목을 빠르게 식별할 수 있습니다.

잠재적 사용 사례

  • 결과 옵션 표시: 필요에 가장 적합한 옵션을 선택할 수 있습니다.

예제

제목 필드는 일반적으로 결과가 의도한 대로인지 파악하기에 충분한 정보입니다. 제목에 충분한 정보가 제공되지 않는 경우 레이블 필드는 결과에 주소 정보 컨텍스트를 추가하는 데 사용됩니다. 레이블 필드는 결과가 렌더링될 때 기본 텍스트에서 강조되지 않는 두 번째 정보 줄로 제공될 수 있습니다. 아래 예제에서는 두 가지 유사한 결과가 제공되며 호텔 주소가 필요에 더 적합한 결과를 선택하는 데 도움이 될 수 있습니다. 또한 맵에서 결과를 렌더링하여 결과 중에서 선택할 수 있도록 위치가 제공됩니다.

Sample request
{ "QueryText": "Marriott", "Filter": { "IncludeCountries": [ "USA" ], "BoundingBox": [ -71.15693983012913,42.261623506672635, -70.97249727163558,42.37584075627763 ] }, "AdditionalFeatures": [ "Core" ] }
Sample response
{ "ResultItems": [ { "Title": "Marriott-Boston Cambridge", "SuggestResultItemType": "Place", "Place": { "PlaceId": "Redacted", "PlaceType": "PointOfInterest", "Address": { "Label": "Marriott-Boston Cambridge, 50 Broadway, Cambridge, MA 02138-4137, United States", "Country": { "Code2": "US", "Code3": "USA", "Name": "United States" }, "Region": { "Code": "MA", "Name": "Massachusetts" }, "SubRegion": { "Name": "Middlesex" }, "Locality": "Cambridge", "District": "MIT", "PostalCode": "02138-4137", "Street": "Broadway", "StreetComponents": [ { "BaseName": "Broadway", "Language": "en" } ], "AddressNumber": "50" }, "Position": [ -71.0858, 42.36294 ], "Distance": 5212, ... }, { "Title": "Marriott-Boston Copley Place", "SuggestResultItemType": "Place", "Place": { "PlaceId": "Redacted", "PlaceType": "PointOfInterest", "Address": { "Label": "Marriott-Boston Copley Place, 110 Huntington Ave, Boston, MA 02116-5706, United States", "Country": { "Code2": "US", "Code3": "USA", "Name": "United States" }, "Region": { "Code": "MA", "Name": "Massachusetts" }, "SubRegion": { "Name": "Suffolk" }, "Locality": "Boston", "District": "Back Bay", "PostalCode": "02116-5706", "Street": "Huntington Ave", "StreetComponents": [ { "BaseName": "Huntington", "Type": "Ave", "TypePlacement": "AfterBaseName", "TypeSeparator": " ", "Language": "en" } ], "AddressNumber": "110" }, "Position": [ -71.0792, 42.34701 ], "Distance": 3362, ... }, ... ], "QueryRefinements": [] }
cURL
curl --request POST \ --url 'https://places.geo.eu-central-1.amazonaws.com/v2/suggest?key=Your_Key' \ --header 'Content-Type: application/json' \ --data '{ "QueryText": "Marriott", "Filter": { "IncludeCountries": [ "USA" ], "BoundingBox": [ -71.15693983012913,42.261623506672635, -70.97249727163558,42.37584075627763 ] }, "AdditionalFeatures": [ "Core" ] }'
AWS CLI
aws geo-places suggest --key ${YourKey} \ --query-text "Marriott" \ --filter '{"IncludeCountries": ["USA"], "BoundingBox": [ -71.15693983012913,42.261623506672635, -70.97249727163558,42.37584075627763]}' \ --additional-features "Core"