Skip to content
HALOWERK

Ortwerk

route deviation

Indexes the planned polyline (R-tree over segments) and measures every track point’s distance to it with a local equirectangular projection; consecutive points beyond the corridor form an excursion (minimum number of points configurable) reported with entry/exit indices, times, maximum distance, detour path length (haversine, mean Earth radius 6 371 008.8 m) and the route stations where the vehicle left and rejoined. Coverage samples the planned route at a fixed step and checks the distance.

POST https://ort.halowerk.com/v1/route-deviation

Inputs

Fields of the published input schema
FieldTypeRequiredDescription
planned_routearrayYesPlanned route as [lon, lat] coordinates (GeoJSON LineString order).
trackarrayYesDriven GPS track in driving order; t optional (all or none).
corridor_mnumberNoAllowed lateral distance from the planned route in metres.
min_off_route_pointsintegerNoConsecutive off-route points needed to report an excursion (filters GPS noise).
sample_step_mnumberNoSampling step along the planned route for the coverage check.
Show full input schema
{
  "type": "object",
  "additionalProperties": false,
  "required": [
    "planned_route",
    "track"
  ],
  "properties": {
    "planned_route": {
      "type": "array",
      "minItems": 2,
      "maxItems": 20000,
      "items": {
        "type": "array",
        "minItems": 2,
        "maxItems": 2,
        "items": {
          "type": "number"
        },
        "description": "[longitude, latitude] in WGS84 degrees."
      },
      "description": "Planned route as [lon, lat] coordinates (GeoJSON LineString order)."
    },
    "track": {
      "type": "array",
      "minItems": 2,
      "maxItems": 20000,
      "items": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "lat",
          "lon"
        ],
        "properties": {
          "lat": {
            "type": "number",
            "minimum": -90,
            "maximum": 90,
            "description": "Latitude (WGS84)."
          },
          "lon": {
            "type": "number",
            "minimum": -180,
            "maximum": 180,
            "description": "Longitude (WGS84)."
          },
          "t": {
            "type": "string",
            "maxLength": 40,
            "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}(?::\\d{2}(?:\\.\\d{1,3})?)?(?:Z|[+-]\\d{2}:\\d{2})$",
            "description": "Timestamp (ISO 8601 with time zone), optional."
          }
        }
      },
      "description": "Driven GPS track in driving order; t optional (all or none)."
    },
    "corridor_m": {
      "type": "number",
      "minimum": 5,
      "maximum": 5000,
      "default": 100,
      "description": "Allowed lateral distance from the planned route in metres."
    },
    "min_off_route_points": {
      "type": "integer",
      "minimum": 1,
      "maximum": 1000,
      "default": 2,
      "description": "Consecutive off-route points needed to report an excursion (filters GPS noise)."
    },
    "sample_step_m": {
      "type": "number",
      "minimum": 5,
      "maximum": 5000,
      "default": 25,
      "description": "Sampling step along the planned route for the coverage check."
    }
  }
}

Open original schema

Published input example

{
  "planned_route": [
    [
      7,
      52
    ],
    [
      7.02,
      52
    ]
  ],
  "track": [
    {
      "lat": 52,
      "lon": 7
    },
    {
      "lat": 52.0027,
      "lon": 7.01
    },
    {
      "lat": 52,
      "lon": 7.02
    }
  ],
  "corridor_m": 100
}

Result & documentation

Machine-readable documentation of this hub

Source of this page: the published HALOWERK catalog. Updated: 2026-11-17 UTC.

More endpoints in this hub

All endpoints in this hub →