We are using the XServer2 calculateRoute operation and have the following problem:
If, for example, prohibitedCountries=["CH"] is specified in the GeographicRestrictions and the route contains an arrival stop within this prohibited country, a route will still be calculated if Course.Violations.Enabled=true is specified in the routing profile. This is okay at first, since we are indicating to the user that there is a violation for example due to the truck attributes.
But the particular thing is that the route ends right at the border of the forbidden country. Now I expected a RouteViolationEvent to be returned from the server if resultFields.eventTypes.ROUTE_VIOLATION_EVENT is specified, from which we can conclude that the route is marked as violated due to a forbidden country. Unfortunately, it seems that this is not the case.
So the following problem we would like to solve:
a) Course.Violations.Enabled=true can be used in the routing profile.
b) From the routing response it should be possible to determine that the route is incomplete due to a prohibited country.
We would be very glad if you can help us with this problem.
With kind regards
Andreas Schönebeck
ESYS GmbH Berlin
Detect Routing Country Violation
Re: Detect Routing Country Violation
This is not correct. When you set prohibitedCountries the engine will no load map data for these countries. In other words: as far as the engine is concerned that country does not exist for the request.a route will still be calculated if Course.Violations.Enabled=true is specified in the routing profile
In this case the normal linking behavior will occur (linking is the term for connecting an input waypoint to the road network). This means our engine will search for the nearest road by airline and connect your input to this road. In your example the nearest road will be then outside of CH.
A screenshot of a small example: Here you see I have a waypoint in CH and the engine will link to directly to the nearest road which is in DE.
I'm not sure what can be done to solve your use case. The way the engine prohibits countries cannot be changed since we need it for high performance routing to keep map data limited in a single network. As for way to work around this: i don't know your use case, i would recommend you would discuss this 1:1 with your primary xServer consultant.
Joost Claessen
Senior Technical Consultant
PTV Benelux
Senior Technical Consultant
PTV Benelux
- Bernd Welter
- Site Admin
- Posts: 2684
- Joined: Mon Apr 14, 2014 10:28 am
- Contact:
Re: Detect Routing Country Violation
Hi Andreas, Joost,
thanks for the quick response, Joost. I was on vacation and will now get in touch with Andreas 1:1.
Best regards,
Bernd
thanks for the quick response, Joost. I was on vacation and will now get in touch with Andreas 1:1.
Best regards,
Bernd
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...
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...
- Bernd Welter
- Site Admin
- Posts: 2684
- Joined: Mon Apr 14, 2014 10:28 am
- Contact:
Re: Detect Routing Country Violation
Here's some generic info from DEV (Max):
Bernd
- If you assign routingProfile.linking.maximumDistanceToSegment to a very low value (e.g. 100) you'd receive a
WaypointNotLinkableFault - Input waypoint coordinates located very close to the border could be linked to the "allowed" neighbour country.
- Geographic restrictions are HARD constraints which cannot be overruled by "violations allowed".
- A potential workaround for your usecase might be: try to route without prohibiting countries and then use route events (CountryEvent) to check whether a critical country is used. You can then inform the user about this "usecase violation".
Bernd
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...
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...
-
- Posts: 15
- Joined: Fri Jul 09, 2021 3:11 pm
Re: Detect Routing Country Violation
Thanks for your information. We had wrongly used OnRoadWaypoint. We have now switched to OffRoadWaypoint and combined the request with a low value for routingProfile.linking.maximumDistanceToSegment which then leads to an error as expected.Joost wrote:This is not correct. When you set prohibitedCountries the engine will no load map data for these countries. In other words: as far as the engine is concerned that country does not exist for the request.a route will still be calculated if Course.Violations.Enabled=true is specified in the routing profile
In this case the normal linking behavior will occur (linking is the term for connecting an input waypoint to the road network). This means our engine will search for the nearest road by airline and connect your input to this road. In your example the nearest road will be then outside of CH.
- Bernd Welter
- Site Admin
- Posts: 2684
- Joined: Mon Apr 14, 2014 10:28 am
- Contact:
Re: Detect Routing Country Violation
Brilliant. Here's also an example for the difference between cost optimized routing and the old school abstract routing.
Maybe monetary cost optimized routing is also important to consider
Maybe monetary cost optimized routing is also important to consider
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...
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...