Symptom
A developer considers using DirectDistance as an alternative to ExistingDistanceMatrix for planTours optimization, hoping it will allow dynamic constraint application without a pre-computed matrix.
Cause
DirectDistance is sometimes confused with a lightweight routing mode. It is not a routing mode; it computes straight-line (as-the-crow-flies / Euclidean) distances between points.
Resolution
Do not use DirectDistance for logistics optimization scenarios that require real road constraints. It does not consider:
- Road network topology
- Tunnel restrictions or ADR codes
- Weight, height, or dimension restrictions
- Turn restrictions, one-way streets, or road closures
- Actual driving distances or travel times
DirectDistance is appropriate only for quick approximations where exact road routing is irrelevant, for example when pre-filtering a large set of candidate stops for a rough feasibility check.
For all production logistics planning with real vehicle constraints, use either:
- ExistingDistanceMatrix with a properly configured HPR (fixed profile, high performance)
- xRoute with VehicleParametersAtWaypoint (dynamic per-leg recalculation, higher latency)
Related articles
PTV xServer 2: PTV_TruckAttributes feature layer: role and requirement for ADR routing
PTV xServer 2: Dynamic vehicle state changes not supported in ExistingDistanceMatrix planTours
PTV xServer 2 :ADR tunnel restrictions not applied in planTours when using ExistingDistanceMatrix
PTV xServer 2: Route divergence after changing vehicle parameters (height, weight)