Page 1 of 1

HOWTO: limit routing to specific countries?

Posted: Fri Oct 21, 2016 11:06 am
by Bernd Welter
Hello there,

today I've been asked whether there is an opportunity to make sure a route doesn't leave a given country.
The customer spent a lot of time in blocking lots of border points but in this case it is not necessary:
You can simply use the RoutingOption.ROUTING_COUNTRIES and specify one or more countries using their code.
The stations of both routings are equal: both located in Switzerland. While the route on the left takes a passage through France/Alsace the route on the right is limited to Switzerland by RoutingOption.ROUTING_COUNTRIES=41. This causes a detour but ensures business rules of the customer.
The stations of both routings are equal: both located in Switzerland. While the route on the left takes a passage through France/Alsace the route on the right is limited to Switzerland by RoutingOption.ROUTING_COUNTRIES=41. This causes a detour but ensures business rules of the customer.
Besides this whitelist approach you may also use the blacklist. In this case the given countries are forbidden. The RoutingOption.EXCLUDE_COUNTRIES is the blacklist parameter.

Best regards Bernd

PS: There are further posts dealing with this...
http://xserver.ptvgroup.com/forum/searc ... _COUNTRIES