简体   繁体   中英

How to avoid the motorway road in Here map API query

I want to avoid the motorway road when calculate the route between the start and destination

https://router.hereapi.com/v8/routes?transportMode=car&motorway:-1&origin=52.120066,11.570918&destination=52.282376,6.687846&return=travelsummary,polyline&apikey=<key>

But above query doesn't work, it not avoid the motorway

Refer documents: https://developer.here.com/documentation/routing/dev_guide/topics/resource-param-type-routing-mode.html

And I already check their is possibility of the route, to avoid the motorway.

https://www.google.com/maps/dir/ '52.120066,11.570918'/'52.282376,6.687846'/@52.3407684,7.9868359,8z/data=.3m1.4b1.4m12.4m11!1m3!2m2!1d11.570918!2d52.120066!1m3!2m2!1d6.687846!2d52.282376!2m1!1b1!3e0

As per the Routing v8 documentation the proper parameter to avoid all highways is avoid[features]=controlledAccessHighway instead of motorway:-1

https://router.hereapi.com/v8/routes?transportMode=car&avoid[features]=controlledAccessHighway&origin=52.120066,11.570918&destination=52.282376,6.687846&return=travelsummary,polyline&apikey=..

Note : probably better value to use is tollRoad as it allows highways without tolls (eg in Germany)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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