HOWTO: limit routing to specific countries?

This forum deals with any kind of routing computation whether it is simple A:B-routing, calculation of isochrones, simple matrix computation or nearest search.
Post Reply
User avatar
Bernd Welter
Site Admin
Posts: 2564
Joined: Mon Apr 14, 2014 10:28 am
Contact:

HOWTO: limit routing to specific countries?

Post 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
Bernd Welter
Technical Partner Manager Developer Components
PTV Logistics - Germany

Bernd at... The Forum,LinkedIn, Youtube, StackOverflow
I like the smell of PTV Developer in the morning... :twisted:
Post Reply