繁体   English   中英

避免区域和地理围栏/多边形的路由

[英]Routing with avoid area and geofence / polygon

我想在使用路由 API 时避开特定街道。我有数据点来创建地理围栏或多边形来表示这些特定街道。 路由器 API 最多只接受 20 个边界框。 我尝试发送 20 个 avoid area bounding boxes 来表示道路,但结果不可靠(例如在对角线上)。

有没有办法发送地理围栏/多边形而不是边界框? 或任何其他方式来避免某些街道? 非常感谢你

请尝试使用avoid[segments]而不是avoid[areas]来避开特定道路。 在需要避开的道路太多的情况下,您还可以将avoid[segments]参数放入请求正文中,并向同一端点发送POST请求。

为了获得您想要避开的道路的segmentId ,您可以添加参数spans=segmentId进行正常路由调用,然后查看响应的spans部分中的topologySegmentId属性。

https://developer.here.com/documentation/routing-api/api-reference-swagger.html

您必须为您的用例进行以下调用。

1>Rest调用获取segmentId为路由。

https://router.hereapi.com/v8/routes apikey={your_app_id}& origin=32.834496,74.81515& destination=32.811632,75.816037& return=polyline,summary,actions,instructions& spans=segmentId& transportMode=car&

2>Rest Call 以获取 get Route with Avoid[segments]

https://router.hereapi.com/v8/routes apikey={your_app_id}& origin=32.834496,74.81515& destination=32.811632,74.816037& return=polyline,summary,actions,instructions& spans=segmentId& transportMode=car& Avoid[segments]=here:cm:segment:808368834,here:cm:段:808095972

HERE 路由 API 现在支持多边形避开区域, https://www.here.com/learn/blog/routing-supports-polygons-for-avoid-areas

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM