View a markdown version of this page

如何使用出行模式获取建议 - Amazon Location Service

本文属于机器翻译版本。若本译文内容与英语原文存在差异,则一律以英文原文为准。

如何使用出行模式获取建议

TravelMode在 “建议” 请求中使用,以根据用户的交通方式提高地点建议的相关性。

潜在使用案例

  • 车队应用程序:在司机键入查询内容时建议适合卡车的停靠点和服务。

  • Ride-sharing:根据车辆类型确定相关的上车和下车地点的优先顺序。

示例

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提高了相关性,但不会筛选结果。