How to route inside a given country or countries?
Posted: Tue Mar 17, 2020 10:48 am
Hi there,
I've been asked whether it is possible to ensure a routing track stays within specific countries, for example "Germany only" or "Germany+Austria". This is possible with the following approaches:
Bernd
I've been asked whether it is possible to ensure a routing track stays within specific countries, for example "Germany only" or "Germany+Austria". This is possible with the following approaches:
- If you work with profile snippets check this snippet - this also works with xTour (please consider the complete process!):
Code: Select all
<?xml version="1.0" encoding="UTF-8"?> <Profile> <Routing majorVersion="2" minorVersion="0"> <Algorithm> <GeographicRestrictions> <AllowedCountry countryCode="49"></AllowedCountry> </GeographicRestrictions> </Algorithm> </Routing> </Profile>
- xRoute1: use the RoutingOption.ROUTING_COUNTRIES : A list of countries to use exclusively in route calculation (*)
The list has to be described as a string of comma separated values. Legal values are either PTV numbers (IU) or ISO2 or ISO3 codes: integration unit codes. Please note that ISO codes do not work for Russia, Australia, the United States and Canada.
BENEFIT: easy to access - DISADVANTAGE: Doesn't work with xTour - xRoute2: com.ptvgroup.xserver.routing.GeographicRestrictions
Bernd