Skip to content

Add GeoBounds and type the geography doors with Latitude and Longitude - #71

Merged
LahaLuhem merged 5 commits into
mainfrom
feature/#65-add-geobounds
Aug 18, 2026
Merged

Add GeoBounds and type the geography doors with Latitude and Longitude#71
LahaLuhem merged 5 commits into
mainfrom
feature/#65-add-geobounds

Conversation

@LahaLuhem

Copy link
Copy Markdown
Owner

Closes #65.

GeoBounds is a GeoJSON bbox where west > east is legal rather than refused, that being how
RFC 7946 §5.2 spells a box across the antimeridian. crossesAntimeridian reports the crossing and
contains honours it, so the case that goes wrong near ±180 is a type-level fact instead of
something every caller re-derives. Geohash.bounds returns one, so a geohash can hand back the cell
it names rather than only a point inside it.

Breaking, minted_geography major. GeoCoordinate.from took two doubles and returned a
ParseOutcome; it now takes a Latitude and a Longitude and cannot fail. tryFrom is the
raw-number door, widened to num. The range moved into the types, so it is prevented at the
assembly doors and only parse still diagnoses it, text being where unchecked input arrives.

The edges are numbers rather than two GeoCoordinate corners deliberately: a coordinate folds
-180 onto +180, right for a point and wrong for an edge, and folded corners would turn
-180,-90,180,90 into a meridian line. Reasoning in APPENDIX.md#geo-bounds-value-type.

Worth settling before this releases: #70 asks whether the getters get typed too. A probe says
implements double keeps the range, swap and generic guarantees while removing the arithmetic tax,
so if it lands it can ride this same major rather than forcing a second one.

@LahaLuhem
LahaLuhem force-pushed the feature/#65-add-geobounds branch from 6a31df0 to 537046a Compare August 18, 2026 13:49
@LahaLuhem
LahaLuhem merged commit 5b1243c into main Aug 18, 2026
28 checks passed
@LahaLuhem
LahaLuhem deleted the feature/#65-add-geobounds branch August 18, 2026 15:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add GeoBounds (a bounding box that may cross the antimeridian)

1 participant