Geometry Utilities API
ToolkitDistance, 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| Parameter | Type | Status |
|---|---|---|
| op | string | Required |
| from | array | Optional |
| to | array | Optional |
| path | array | Optional |
| polygon | array | Optional |
Example request
Credit cost: 1 creditcurl -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
Routing APIRoute Optimization APIGeocoding APIPlaces APIMatrix APIIsochrones APIMap Matching APINearest APITrip API (TSP)Location ClusteringDirections APIAlternative Routes APISnap to Road APIAutocomplete APIBatch Geocoding APITimezone APIElevation APIBoundary Lookup APIGeofencing APIElevation Profile APISolar APICoordinate Conversion APICountry Info API