OSRMRoute

Geometry Utilities API

Toolkit

Distance, bearing, area, centroid, simplification and polyline encode/decode — spatial math as a service.

Overview

The Geometry Utilities API is spatial math as a service: distance and bearing between points, a destination from a bearing and distance, midpoints, path length, polygon area, centroids, Douglas–Peucker simplification and Google polyline encode/decode. One endpoint, pick the operation with the op field. Pure computation, works worldwide.

API reference

POST/api/1/geometry
ParameterTypeStatus
opstringRequired
fromarrayOptional
toarrayOptional
patharrayOptional
polygonarrayOptional

Example request

Credit cost: 1 credit
curl -X POST "https://osrmroute.com/api/1/geometry?key=YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{"op":"distance","from":[40.37,49.85],"to":[40.40,49.86]}'

Other services