View a markdown version of this page

如何使用旅遊模式進行搜尋 - Amazon Location Service

本文為英文版的機器翻譯版本,如內容有任何歧義或不一致之處,概以英文版為準。

如何使用旅遊模式進行搜尋

TravelMode 表示您的行動模式。這可改善搜尋結果的相關性。例如,當 TravelMode設為 時,搜尋「EV 充電站」會傳回適合卡車的充電站Truck

潛在的使用案例

  • 機群管理:尋找可容納卡車或商用車輛的燃料站或停靠站。

  • 導航應用程式:根據使用者是否駕駛汽車、駕駛摩托車或駕駛卡車,提供更相關的結果。

範例

Sample request
{ "QueryText": "fuel station", "BiasPosition": [-122.3321, 47.6062], "TravelMode": "Truck" }
Sample response
{ "ResultItems": [ { "PlaceId": "<Redacted>", "PlaceType": "PointOfInterest", "Title": "Pilot Travel Center, Seattle, WA", "Distance": 1520 } ] }
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": "fuel station", "BiasPosition": [-122.3321, 47.6062], "TravelMode": "Truck" }'
AWS CLI
aws geo-places search-text --key ${YourKey} --query-text "fuel station" --bias-position -122.3321 47.6062 --travel-mode Truck

開發人員秘訣

  • 有效值為 CarScooterTruck

  • TravelMode 改善相關性,但不會篩選結果。結果可能仍會包含非特定於行程模式的位置。