首页 > 解决方案 > 使用 HERE 仅使用指定的路线计算路线

问题描述

只要可能,我想仅使用城市中可用路线的子集来计算从 A 到 B 的路线(如果 A 或 B 不在道路子集上,我仍然需要计算路线)。我尝试使用avoidareas,但很难定义矩形以避免在道路之外(我在某处看到盒子的数量是有限的)。

标签: overlayhere-api

解决方案


您能否解释一下“路线的子集”是什么意思。你的意思是要避开某种特定的道路吗?如果您想始终包含某条道路,您始终可以使用航路点来引导路线通过这些道路。通常,路由算法旨在“避免”而不是“偏爱”一个区域。

此处解释了有关如何避免矩形的各种示例-https ://developer.here.com/documentation/routing/topics/example-route-avoiding-an-area.html

此处解释了如何使用航点 - https://developer.here.com/documentation/routing/topics/resource-param-type-waypoint.html

此处解释了如何避免某种道路类型 - https://developer.here.com/documentation/routing/topics/avoiding-certain-road-types.html


推荐阅读