Symptom
When calculating a route to a segment temporarily closed due to roadworks or similar events, PTV xServer may return an unrealistically long travel time.
Unlike other products (e.g. Map&Guide Internet), where no route is returned in such cases, xServer does calculate a route — but it assumes the vehicle waits until the closure ends.
Cause
This behavior occurs when:
The destination is located on a temporarily closed road segment.
The system determines that the segment will reopen in the future and includes a delay in the travel time accordingly.
Example: Traffic Events in Response
When calling TRAFFIC_EVENTS for the route, you may see a result like this:
"events": [
{
"latitude": 52.479051174,
"longitude": 13.432830347,
"startsAt": "2023-09-13T16:15:34+02:00",
"distanceFromStart": 0,
"travelTimeFromStart": 0,
"traffic": {
"delay": 28613,
"description": "Rollbergstraße eastbound at Berlin closed",
"accessType": "ENTER"
}
},
{
"latitude": 52.479272211,
"longitude": 13.434499653,
"startsAt": "2023-09-14T00:13:09+02:00",
"distanceFromStart": 116,
"travelTimeFromStart": 28655,
"traffic": {
"delay": 28613,
"description": "Rollbergstraße eastbound at Berlin closed",
"accessType": "EXIT"
}
}
]
This represents:
A delay of ~28,600 seconds (~8 hours), which causes the inflated travel time.
The closure begins and ends at specific timestamps, and the routing engine "waits" accordingly.
Resolution
Workaround: Adjust the Travel Time
If you need more realistic travel times, you can:
Extract the
trafficDelayvalue from the route result.Subtract this delay from the total travel time.
Note: This workaround may distort the route's realism if multiple traffic events are present, as not all delays are due to closures.
Recommendation
For production use, especially in critical planning scenarios:
Consider checking traffic events on the destination segment before routing.
Or, if temporary closures should be avoided entirely, exclude traffic from the routing calculation using a different profile.