HerePy icon indicating copy to clipboard operation
HerePy copied to clipboard

avoid[features] not working for routing v8

Open zaksuo opened this issue 1 year ago • 1 comments

Hello there,

I struggled for a while figuring out why the parameters I was passing to avoid tollTransponders and tollRoads weren't working. After debugging a bit and printing requests sent to Here routing API, I figured out that the avoid parameter wasn't recognized :

{"notices":[{"title":"The provided parameter 'avoid=%7B%27%5Bfeatures%5D%27%3A+%27controlledAccessHighway%2Ctunnel%27%7D' is unknown.","code":"unknownParameter","severity":"info"},{"title":"The provided parameter 'truck=%7B%27%5Bfeatures%5D%27%3A+%27controlledAccessHighway%2Ctunnel%27%7D' is unknown.","code":"unknownParameter","severity":"info"}],

For now I did some quick & dirty fixes in the library, changing this parameters to plain text to make it work and send requests formatted like this :

https://router.hereapi.com/v8/routes?transportMode=truck&origin=48.9048418,2.306274&destination=48.7985884,1.6674979&apiKey=XXXXXXXXXX&departureTime=2021-09-28T10:30:00+00:00&routingMode=short&avoid[features]=controlledAccessHighway,tunnel&units=metric&lang=fr-FR&return=summary,tolls

In the Here documentation, avoidance parameters are given like this :

&avoid[features]=tollRoad

But i'm not able to find any request example with multiple avoidance types with features/tollTransponders/segments/etc. After testing it seems that they have to appear as specific parameters like this :

&avoid[features]=controlledAccessHighway,tunnel,tollRoad&avoid[tollTransponders]=all

It would be great to have an official update on this if you have some time !

Thanks

zaksuo avatar Sep 08 '23 08:09 zaksuo

Hi @zaksuo thanks for opening this issue. I tried to run sample code available under examples folder within routing_api.py and it worked well. I would need more details about your problem, provide me your python code that calls the route_v8 of routing_api with details.

abdullahselek avatar Sep 13 '23 13:09 abdullahselek