gpt4 book ai didi

ios - HERE Api - 使用 iOS/Android SDK 和 REST API 的不同路线结果

转载 作者:行者123 更新时间:2023-11-29 05:30:42 26 4
gpt4 key购买 nike

我在使用移动 SDK 进行路线和土路方面遇到一些问题。使用以下参数和 REST API 来计算路线:

maneuverattributes: "direction,action"
mode: "fastest;car;dirtRoad:-3,boatFerry:0"
representation: "display"
routeattributes: "waypoints,summary,shape,legs"
waypoint0: "37.277430,13.572681"
waypoint1: "37.287706,13.817110"
waypoint2: "37.276359,14.097211"
waypoint3: "37.316294,14.130108"
waypoint4: "37.368569,14.334077"
waypoint5: "37.238077,14.512665"
waypoint6: "37.230885,14.538092"
waypoint7: "37.181701,14.772583"
waypoint8: "37.162439,14.751674"
waypoint9: "37.041651,14.795221"
waypoint10: "36.926747,14.747216"
waypoint11: "36.885887,14.686213"
waypoint12: "36.837361,14.606543"

这是一个示例(替换您的应用 ID 和代码):

https://route.api.here.com/routing/7.2/calculateroute.json?waypoint0=37.277430%2C13.572681&waypoint1=37.287706%2C13.817110&waypoint2=37.276359%2C14.097211&waypoint3=37.316294%2C14.130108&waypoint4=37.368569%2C14.334077&waypoint5=37.238077%2C14.512665&waypoint6=37.230885%2C14.538092&waypoint7=37.181701%2C14.772583&waypoint8=37.162439%2C14.751674&waypoint9=37.041651%2C14.795221&waypoint10=36.926747%2C14.747216&waypoint11=36.885887%2C14.686213&waypoint12=36.837361%2C14.606543&mode=fastest%3Bcar%3Btraffic%3Aenabled%3BdirtRoad%3A-3&app_id=<YOUR APP ID>&app_code=<YOUR APP CODE>&departure=now

如果我设置dirtRoad:0dirtRoad:-3,路线是相同的

使用移动 SDK(iOS 或 Android)时,我收到以下错误并且未计算路线:

"NMARoutingErrorViolatesOptions"

我将以下参数(与 REST 示例中使用的路径点相同)传递给 NMACoreRouter.calculateRoute()(以 iOS 为例)

let routingMode = NMARoutingMode()
routingMode.transportMode = .car
routingMode.routingType = .fastest
routingMode.routingOptions = NMARoutingOption.avoidDirtRoad;

删除NMARoutingOption.avoidDirtRoad会计算路线,但这样做我认为 route 包含土路。这是一个错误吗?或者 iOS 选项 NMARoutingOption.avoidDirtRoad 与 REST dirtRoad:-3 不同?如何在两个平台上获得一致的结果?

最佳答案

一般来说,HERE Routing REST API 和 HERE Mobile SDK 使用的算法和底层 map 数据不同,因此路线形状始终可能存在差异。 HERE Routing REST API 和 HERE Mobile SDK 的 map 更新周期也略有不同(每周与每月),不幸的是没有办法解决这个问题。

关于ios - HERE Api - 使用 iOS/Android SDK 和 REST API 的不同路线结果,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57614504/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com