OSRMRoute

Location Clustering

Grouping

Group large sets of locations into balanced clusters by proximity — perfect for splitting deliveries across drivers or defining service zones.

Overview

The Location Clustering API groups large sets of locations into balanced clusters by proximity. Give it hundreds of points and a target number of groups, and it partitions them into compact, well-separated clusters — perfect for splitting deliveries across drivers, defining service territories or pre-grouping stops before optimisation.

API reference

POST/api/1/cluster
ParameterTypeStatus
customersarrayRequired

Example request

Credit cost: 3 credits
curl -X POST "https://osrmroute.com/api/1/cluster?key=YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{"customers":[[49.85,40.37],[49.86,40.40],[49.83,40.39]],"clusters":2}'

Other services