View a markdown version of this page

如何使用旅遊模式取得建議 - Amazon Location Service

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

如何使用旅遊模式取得建議

在建議請求TravelMode中使用 ,以根據使用者的運輸模式來改善放置建議的相關性。

潛在的使用案例

  • 機群應用程式:建議適合卡車的停靠站和服務,因為驅動程式會輸入其查詢。

  • 乘車共享:根據車輛類型排定相關上車和下車地點的優先順序。

範例

Sample request
{ "QueryText": "parking", "BiasPosition": [-122.3321, 47.6062], "TravelMode": "Scooter" }
Sample response
{ "ResultItems": [ { "Title": "Pacific Place Parking, Seattle, WA", "SuggestResultItemType": "Place", "Place": { "PlaceId": "<Redacted>", "PlaceType": "PointOfInterest", "Distance": 830 } } ] }
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": "parking", "BiasPosition": [-122.3321, 47.6062], "TravelMode": "Scooter" }'
AWS CLI
aws geo-places suggest --key ${YourKey} --query-text "parking" --bias-position -122.3321 47.6062 --travel-mode Scooter

開發人員秘訣

  • 有效值為 CarScooterTruck

  • TravelMode 改善相關性,但不會篩選結果。