【问题标题】:Waypoint heading works only on the first waypoint航点航向仅适用于第一个航点
【发布时间】:2020-01-06 23:03:51
【问题描述】:

我正在尝试获取一条遵循航路点中提供的航向信息的路线。似乎只有第一个航路点的航向会影响路线几何形状。

例如:

"https://route.api.here.com/routing/7.2/calculateroute.json" \
"?app_id=xxxx&app_code=xxxx" \
"&waypoint0=geo!49.010830,8.417029;;;90" \
"&waypoint1=passThrough!49.011843,8.418113;;;180" \
"&waypoint2=geo!49.010020,8.419840;;;240" \
"&mode=shortest;car;traffic:disabled" \
"&routeattributes=wp,sm,sh"

screenshot of the result

返回第二个航路点从南到北经过的路线,即使它应该是相反的。最后一个航路点也是如此。路线的几何形状仅在更改第一个航向时发生变化。

矩阵请求也是如此。只有起点的航向会影响距离。

我已经看到了一个可能的解决方案here,但它使事情变得复杂,因为我应该为数百个航点发出路线请求,因此无法手动检查所有前缀。

有没有办法使用路由 API 来解决我的问题?或者我可能需要不同的 API?

【问题讨论】:

    标签: here-api direction heading


    【解决方案1】:

    stopOver 允许 180 度转弯,但 passThrough 不允许。

     var router = platform.getRoutingService(),
        routeRequestParams = {
          mode: 'shortest;car;traffic:disabled',
          representation: 'display',
          routeattributes : 'waypoints,summary,shape,legs',
          maneuverattributes: 'direction,action',
          waypoint0: 'geo!49.010830,8.417029;;;90', // Brandenburg Gate
          waypoint1: 'stopOver!49.011843,8.418113;;;180',  // Friedrichstraße Railway Station
          waypoint2: 'geo!49.010020,8.419840;;;240'
        };
    

    【讨论】:

    • 我不需要中途停留。我需要在给定方向上通过。我希望我的路线是这样的: - 从 49.010830,8.417029 开始并向东行驶 -> 前往 49.011843,8.418113 并从南到北经过航路点 -> 前往 49.010020,8.419840 并从东侧到达目的地.有可能吗?
    • 你能用超过 3 个航点来做到这一点吗?或者你有特定的 3 个航点?
    • route.api.here.com/routing/7.2/… 仍然给出错误的(据我理解)结果。航点 1 应从北向南通过,航点 2 从东向西通过,航点 3 从南向北通过。只有第一个航路点的航向会影响路线。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2018-11-21
    • 2018-04-11
    • 2014-02-16
    • 1970-01-01
    • 1970-01-01
    • 2018-09-15
    • 1970-01-01
    相关资源
    最近更新 更多