Interface RouteLengthComputer

All Known Implementing Classes:
BRouterRouteLengthComputer, PointToPointLengthComputer

public interface RouteLengthComputer
Computes the length of a single position list for the analyze command.

This is the extension seam for BRouter (specs/00055 P3): the default PointToPointLengthComputer measures recorded geometry point-to-point (track length) and reports planned Route/Waypoints lists as straight-line. A future BRouter-backed implementation will route Route-type lists that fall inside its rd5 segment coverage and report routed on-road distances, falling back to straight-line outside coverage. Nothing else in the analyzer needs to change: swap the RouteLengthComputer instance in FileAnalyzer.

Author:
Christian Pesch
  • Method Details

    • computeLength

      RouteLengthComputer.LengthResult computeLength(BaseRoute<?,?> route)
      Parameters:
      route - a single position list from the parsed file
      Returns:
      the length in metres and its kind, or null if the list has no computable length (e.g. fewer than two positions with coordinates)