# distance-matrix

compute great-circle (haversine) distances between points and the nearest neighbour of each

- **Space:** geospatial-public (https://github.com/Tech-Realm/space-geospatial-public/tree/main/distance-matrix)
- **Level:** L2 (as the registry reports it)
- **Keys it needs (names only):** none
- **Tools:** python3
- **Routes:** python-stdlib; checks: 1
- **Uses:** new (no recorded use yet)
- **Install:** `logicpacks pack use geospatial-public/distance-matrix` or MCP `get_pack geospatial-public/distance-matrix`
- **Files:** CHANGELOG.md, code/distances.py, outcome/EVIDENCE.md, outcome/checks.yaml, outcome/fixtures/p.csv, outcome/results.json, pack.yaml, refs/refs.yaml, spec/SPEC.md, spec/source.md

## Purpose (spec/SPEC.md)

## Goal

Compute great-circle (haversine) distances between points and the nearest neighbour of each.

## Steps

1. Put points in a CSV with WGS84 lat/lon (decimal degrees).
2. Run distances.py.
3. For road distance or travel time use a routing engine (maps space).

## Edge cases

- Lat/lon swapped is the most common bug; sanity-check one known pair.
- Antimeridian crossings work with haversine; planar maths does not.

## Don'ts

- Don't use straight-line distance for delivery ETAs.

## Routes (free first)

1. `python-stdlib`: `code/distances.py` (no install).



---

Canonical URL: https://logicpacks.io/packs/geospatial-public/distance-matrix

Developed by TechRealm (techrealm.online), the software team. Operated by Al Jash Trading (Establishment), Abu Dhabi, since 1994, the legal entity that hosts and is responsible for the service. Economic licence CN-1030597, Abu Dhabi Registration Authority. Address: Office 5, Bani Yas West 4, Bani Yas, Abu Dhabi, UAE. Website: https://aljashtrading.com. Contact: hello@logicpacks.io, security@logicpacks.io, WhatsApp +1 713 632 2262 (https://wa.me/17136322262).

Machine-readable index: [/llms.txt](/llms.txt). Plain facts: [/about.md](/about.md). Safety: [/safety.md](/safety.md).
