distance_matrix
Calculate distances between multiple geographic points using the haversine formula. Accepts latitude/longitude coordinates or named location objects to generate a distance matrix in meters without external API calls.
Instructions
Compute haversine distance matrix between multiple points.
Pure computation — no API calls needed. Accepts points as either
[lat, lon] pairs or {"name": ..., "lat": ..., "lon": ...} objects.
Args:
points: JSON array of points. Each point is either:
- [lat, lon] pair (auto-named "Point 1", "Point 2", ...)
- {"name": "Label", "lat": 40.0, "lon": -105.0}
output_mode: "json" (default) or "text"
Returns:
NxN distance matrix in metres between all point pairs
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| points | Yes | ||
| output_mode | No | json |