How to avoid special region Kaliningrad?

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: 2695
Joined: Mon Apr 14, 2014 10:28 am
Contact:

How to avoid special region Kaliningrad?

Post by Bernd Welter »

Cheerio,

these days I've been asked how a routing could be parametrized to avoid the region of Kaliningrad. Here's my feedback:
I see at least two approaches to achieve this goal with xServer2. BOth are based on GeographicRestrictions
  • Use prohibitedCountries to prevent the route from using segments in the russian country as a whole. This is based on so-called integration units which are "countries (Europe)" or "federal states (USA)".
  • Evaluate the prohibitedSegmentsByIntersectingPolylines if the approach above doesn't match your settings to whatever reason. Maybe a bit more complicated because you would have to gather the polyline of the enclave first. You may look into osm-boundaries.com for this. But be aware that the maximum nomber of polygon points
Here's a sample output:
blue: initial route without special parameters.<br />green: route with &quot;prohobittedCountries&quot;:[&quot;RU&quot;]<br />purple : route with &quot;prohibitedSegmentsByIntersectingPolylines&quot;
blue: initial route without special parameters.
green: route with "prohobittedCountries":["RU"]
purple : route with "prohibitedSegmentsByIntersectingPolylines"
Bernd

PS: if you look closely you see that the initial blue route is longer and slowlier than the other alternatives and the question may rise "why did you return blue at all?" - this is because of the network malus values. The blue line uses a bigger distance of major roads.
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