Skip to content

Packs / geospatial-public

bounding-box-and-centroid

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

L2 Checks passed 3 of 3 runsv1.0.0Tech-Realm/space-geospatial-public

Install

logicpacks pack use geospatial-public/bounding-box-and-centroid
get_pack geospatial-public/bounding-box-and-centroid

The second line is the MCP tool call for the LogicPacks connector (Claude Code, Codex, Claude.ai and others). The first run of a pack someone else wrote asks for your yes.

Keys it needs (names only)

None.

Playbooks included

  • Spec: spec/SPEC.md (goal, steps, edge cases, don’ts)
  • Routes: python-stdlib
  • Checks: 1 in outcome/checks.yaml
  • Code: extent.py
  • Tools: python3

Usage, last 8 weeks

New: no recorded use yet.

Purpose (from 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).