Skip to content

Segments and Traversals

What this chapter covers

A journey only becomes something you can compare, price, and learn from once it is cut into measurable pieces. This chapter describes how waypoint-visit boundaries divide a mission into segment traversals, what each traversal records, how the prediction made beforehand is kept beside the actual outcome, and why these records are the raw material for the analytics of Part 6. It is the point where the road network of Part 4 and the mission of Part 5 turn into durable, comparable facts.

The picture

The exit of one Tier-1 waypoint and the entry of the next bound exactly one traversal.

Boundaries cut the journey

The cuts are the waypoint visits from Part 4. When a truck exits one Tier-1 boundary and enters the next, that span is one segment traversal — one observed crossing of one road by one truck.

Only specific places are boundaries. Tier-1 boundaries are the cities every truck on the road passes through, plus the specific origin and destination of the mission at hand. Service stops, fuel stations, rest areas, borders, and ad-hoc pins are valuable context, but they are not automatically boundaries. This is the "compare like with like" rule: a Douala-to-Ngaoundéré segment can be compared across hundreds of missions, but a one-off rest stop cannot become its own statistical segment without making everything incomparable. Optional stops are recorded as facts inside a traversal.

Take our tanker's first leg. Douala and Ngaoundéré are cities, so they cut; the weighbridge and the fuel stop between them are logged as context inside the Douala-Ngaoundéré traversal:

What a traversal records

A segment traversal is a rich, immutable fact. It records, for that one crossing:

  • Time — the transit time (wall clock from exit to entry) and the driving time within it. The gap between them is where the delay lives.
  • Distance and speed — how far the truck drove, and its average and maximum speed.
  • What interrupted it — the count and total duration of stops, of signal gaps, and of idle time.
  • Deviations — the total off-corridor distance and time during the span, and how many times the truck strayed.
  • Fuel and cost — the fuel consumed and the efficiency over the leg, the unit fuel price, and the total cost of the leg (fuel, driver, trailer, tolls, and overhead) where the inputs are available.
  • The road actually taken — a link to the curated road variant the truck drove, resolved by testing the truck's path against the road polygons. Where the path cannot be resolved to a known road, analytics fall back to a route grouping key, so the traversal is still comparable by its endpoint pair.

And it records context — the dimensions that let one traversal be sliced against another without ever re-joining the mission:

  • the driver, the client, the cargo (loaded or empty, and its weight), the trailer, and the convoy;
  • the vehicle's make, model, and year;
  • the weather class, the season (a four-bucket Sahel model — dry-cool, dry-hot, wet-early, wet-peak), and the calendar class of the day;
  • the driver's cumulative driving since 04:00 local that day and over the trailing 7 days, for fatigue analysis;
  • the local hour of day and day of week the crossing fell on.

These dimensions are captured at the moment the segment closes, frozen onto the row, so a report grouping thousands of traversals never has to reconstruct what was true at the time.

Predicted versus actual, side by side

Each traversal also preserves what the estimator predicted for it at the time the segment started — the predicted duration and the confidence level behind it — right next to what actually happened. Keeping the two together on the same row is what lets analysis ask "where did the model expect this leg to take, and how did reality differ?" without rebuilding the estimator's past state. This is not an accuracy scorecard to grade against a promise; it is a correlation input — one more dimension to combine with the others.

Why this exists

These records are the raw material for everything in Part 6. Once traversals accumulate, they can be combined to see what no single mission shows: a truck compared with itself over time (an early maintenance signal when efficiency or dwell quietly degrades), a truck compared with another, a driver with another, and correlations across season, weather, cargo weight, vehicle age, and time of day that are invisible until the dimensions are combined. Per-client profitability falls out of the client dimension; corridor benchmarks fall out across tenants. The whole apparatus of dimensions on a traversal exists precisely so those questions become plain queries.

Edge cases

  • GPS jitter at a boundary. A noisy signal can produce enter-exit-enter within a single batch. The record is keyed to the closing visit, so a jittered boundary yields one traversal, not a burst of phantom crossings.
  • Places passed but not entered. Planned waypoints the truck drove close to but did not enter are captured as a soft list on the traversal, so analysis can see what was bypassed — while tolerating a rare later deletion of one of those waypoints.
  • An unresolved road. When the truck's path cannot be matched to a curated road variant, the road link is left empty and analytics group by the endpoint pair instead; the traversal survives, attributed more coarsely.
  • Repeated visits to the same city. A route that touches the same city twice is handled with occurrence-safe boundaries, so the right crossing closes the right segment.
  • The final leg. The destination segment can close after the mission reaches arrived — including when an owner completes the mission while the truck is already inside the destination geofence — so the last useful actual is captured rather than skipped.
  • Geometry edited later. Each traversal freezes a snapshot of the boundary waypoints' position and radius, so editing a place afterwards never rewrites what a historical row measured.

How it connects

  • Waypoints and road geometry — the visits and Tier-1 boundaries that cut the journey.
  • Progression and ETA — the per-segment baselines these traversals feed back into, and the predictions preserved beside the actuals.
  • The mission lifecycle — arrival and completion, which close the final traversal.
  • Part 6 (fleet intelligence) — the analytics, scorecards, trends, and correlations built on these records.