# bounding-box-and-centroid

summarise a set of points: bounding box, centroid and a GeoJSON bbox ready for map fitBounds

- **Space:** geospatial-public (https://github.com/Tech-Realm/space-geospatial-public/tree/main/bounding-box-and-centroid)
- **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/bounding-box-and-centroid` or MCP `get_pack geospatial-public/bounding-box-and-centroid`
- **Files:** CHANGELOG.md, code/extent.py, outcome/EVIDENCE.md, outcome/checks.yaml, outcome/fixtures/pts.csv, outcome/results.json, pack.yaml, refs/refs.yaml, spec/SPEC.md, spec/source.md

## Purpose (spec/SPEC.md)

## Goal

Summarise a set of points: bounding box, centroid and a GeoJSON bbox ready for map fitBounds.

## Steps

1. Run extent.py on your points.
2. Use bbox with map.fitBounds; centroid as the default map centre.

## Edge cases

- Points spanning the antimeridian give a misleading bbox.
- Centroid of points is not the centre of the area they cover.

## Don'ts

- Don't average raw longitudes across +/-180.

## Routes (free first)

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



---

Canonical URL: https://logicpacks.io/packs/geospatial-public/bounding-box-and-centroid

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).
