here-api - 计算路由在相同的两个地方返回不同的数字
问题描述
使用计算路线时,我在往返所述位置的相同两个位置得到不同的数字。如果它是几英里,我会理解,但我得到一些在我看来相差 20 多英里的差异。
我的查询:
https://route.api.here.com/routing/7.2/calculateroute.xml?app_id={app-id}&app_code={app-code}&mode=fastest;truck&height=5&waypoint0=geo!41.85071,-87.67896;500&waypoint1=geo!40.76282,-81.34159;500
此查询返回
442 英里
如果我切换点:
https://route.api.here.com/routing/7.2/calculateroute.xml?app_id={app-id}&app_code={app-code}&mode=fastest;truck&height=5&waypoint0=geo!40.76282,-81.34159;500&waypoint1=geo!41.85071,-87.67896;500
此查询返回
392 英里
.
我猜我的查询中缺少一些东西,但我似乎无法弄清楚是什么。任何帮助将不胜感激。
谢谢!
解决方案
你可以添加参数 truckRestrictionPenalty=soft
注意:-软惩罚要求在响应中启用路由注释。
https://route.ls.hereapi.com/routing/7.2/calculateroute.json?apiKey={api_key}&mode=fastest;truck&waypoint0=geo!41.85071,-87.67896;500&waypoint1=geo!40.76282,-81.34159;500&truckRestrictionPenalty=soft&routeattributes=notes&maneuverattributes=notes
393 英里
https://route.ls.hereapi.com/routing/7.2/calculateroute.json?mode=fastest;truck&waypoint0=geo!40.76282,-81.34159;500&waypoint1=geo!41.85071,-87.67896;500&truckRestrictionPenalty=soft&routeattributes=notes&maneuverattributes=notes&apiKey={api_key}
392 英里
推荐阅读
- spring-boot - 在 Kubernetes 上使用 Netflix Eureka
- jquery - Jquery在按钮单击时隐藏所有其他div
- service-worker - 如何修改 Workbox 生成的预缓存清单文件?需要 url 前面有 '/'
- visual-studio-2019 - VS2019 中缺少 LaunchSettings.json
- php - 错误:预期的已知函数,得到“GROUP_CONCAT”
- reactjs - Material-ui:选项卡列表中的按钮
- vue.js - (Vue.js) 在模态中滚动也会滚动到模态的后面
- wordpress - 联系表格 7 - [您的姓名] - “无效的邮箱语法”
- python - 在 Plotly 中创建 Scatter 时出现 ValueError
- android - Android maven发布插件未发布项目依赖项