Define "preferred" areas (i.e. opposite of avoid areas)

Hi Team and Supporters of Graphhopper,

I was wondering if it is possible to implemente a “preferred” area in routing by request, that works as exactly the opposite of an avoid area.
My first approach was to increase the priority of the area that I define but this is actually not feasable as the weighting of a priority can be multiplied with a number smaller than 1.
I was thinking about creating a lot of other areas with penalisation like avoid area around my preferred area. This is feasabile in the practice but quite complex and it leads to changes in the selected route: the route avoid completely the avoid areas and do not go through the preferred area.
Does anyone have an idea if this is the right appraoch with bad implementation or if I am completely going wrong?

Thanks in advance,

Alex

You can use the opposite condition like:
{ "if" : "!in_area", "multiply_by": "0.1" }

My first approach was to increase the priority of the area that I define but this is actually not feasable as the weighting of a priority can be multiplied with a number smaller than 1.

PS: For the server-side this is possible or when you disable LM and just use A*.

It was so easy that I feel stupid about having asked! =) I will give it a try and answer with the results so maybe it can be helpful for others.
Thanks a lot!

No worries! That’s the reason we have this forum :slight_smile: