Back to Docs

Navigation API

Route planning and distance calculation with geodesic accuracy.

Distance Calculation

Calculate true geodesic distance between two points using the Azimuthal Equidistant projection.

POST /api/v1/distance
{
  "origin": { "lat": 40.7128, "lng": -74.0060 },
  "destination": { "lat": 51.5074, "lng": -0.1278 }
}

// Response
{
  "distance_km": 5570.22,
  "distance_mi": 3461.02,
  "bearing": 51.2
}

Great Circle Route

Generate waypoints along the shortest path between two points on Earth.

POST /api/v1/route/great-circle
{
  "origin": { "lat": 40.7128, "lng": -74.0060 },
  "destination": { "lat": 35.6762, "lng": 139.6503 },
  "waypoints": 20
}

// Response
{
  "waypoints": [
    { "lat": 40.7128, "lng": -74.0060 },
    { "lat": 45.2, "lng": -80.5 },
    // ... more waypoints
  ],
  "total_distance_km": 10838.67
}

Bearing Calculation

Calculate the initial bearing from one point to another.

POST /api/v1/bearing
{
  "from": { "lat": 40.7128, "lng": -74.0060 },
  "to": { "lat": 51.5074, "lng": -0.1278 }
}

// Response
{
  "initial_bearing": 51.2,
  "final_bearing": 107.8
}