Catalog/geo-cross-track

Geospatial

Cross-track & along-track distance API

Given a point and a great-circle path (start->end), returns the cross-track (perpendicular) distance off the route, the along-track distance from the start, and which side (left/right) the point lies. Answers 'How far off the planned route is this point?', 'How far along the leg have I progressed?'.

Price$0.06per request
MethodPOST
Route/v1/geo/cross-track
StatusLive
MIME typeapplication/json
Rate limit120/minute
Cache0s public
geogiscross-trackalong-trackdeviationpoint-to-pathgreat-circlenavigationrouting
API URLhttps://x402.hexl.dev/v1/geo/cross-track
Integration docs
Example request
{
  "point": {
    "latitude": 51,
    "longitude": 1
  },
  "pathStart": {
    "latitude": 51.5074,
    "longitude": -0.1278
  },
  "pathEnd": {
    "latitude": 48.8566,
    "longitude": 2.3522
  }
}
Example response
{
  "point": {
    "latitude": 51,
    "longitude": 1
  },
  "pathStart": {
    "latitude": 51.5074,
    "longitude": -0.1278
  },
  "pathEnd": {
    "latitude": 48.8566,
    "longitude": 2.3522
  },
  "crossTrackKm": -37.528327,
  "crossTrackMeters": -37528.327,
  "alongTrackKm": 89.07869,
  "side": "right",
  "interpretation": "Point lies 37.528 km to the right of the path, 89.079 km along it from the start. Cross-track is the perpendicular deviation from the great-circle route."
}
Input schema
{
  "type": "object",
  "required": [
    "point",
    "pathStart",
    "pathEnd"
  ],
  "properties": {
    "point": {
      "type": "object",
      "required": [
        "latitude",
        "longitude"
      ],
      "properties": {
        "latitude": {
          "type": "number"
        },
        "longitude": {
          "type": "number"
        }
      },
      "examples": [
        {
          "latitude": 51,
          "longitude": 1
        }
      ]
    },
    "pathStart": {
      "type": "object",
      "properties": {
        "latitude": {
          "type": "number"
        },
        "longitude": {
          "type": "number"
        }
      },
      "examples": [
        {
          "latitude": 51.5074,
          "longitude": -0.1278
        }
      ]
    },
    "pathEnd": {
      "type": "object",
      "properties": {
        "latitude": {
          "type": "number"
        },
        "longitude": {
          "type": "number"
        }
      },
      "examples": [
        {
          "latitude": 48.8566,
          "longitude": 2.3522
        }
      ]
    }
  }
}
Output schema
{
  "type": "object",
  "additionalProperties": true
}