Alternative route favoring a particular shortcut

Hi

I got the post curl working (php) but can’t seem to figure out the Post fields to favor a particular (scenic) service street shortcut without avoiding freeways altogether.

Is it possible to avoid freeways in a bbox or add a wp with a certain weight?

Hey,

I am missing a bit of context, i.e. what you mean by

post curl working (php)

I will try to answer your question nevertheless.

No, there is currently no option to avoid freeways only in a partial bbox.
There is the option to avoid certain areas, have a look at options → avoid_polygons. This would enable you to avoid a dedicated freeway by drawing an avoid_polygon on it.

There is also no option to “weigh” waypoints (which I assume is what wp stands for?).

If you want to force a route via a certain way, it is easiest to set dedicated waypoints doing so.

Best regards

Hi Jakob,

Thanks for the hint, I will try the option with the avoid_polygons to sway it to my preferred route.

I didn’t wanted to use a fixed waypoint as it then would always route that way, even if I intended to go in the opposite direction, because I would then have to check myself whether or not to include it, which seems to be a not so elegant solution.

To clarify my request, yes WP stood for waypoint.
I was using the simple GET requests hitherto. To be able to pass options, I changed it to POST, which works fine. I mentioned that my code worked as others had issues, to make sure it’s clear that I had a question in regards to the post fields, not the mechanics of the request itself.

1 Like