Summary
Implement CellToBoundary which returns the geographic polygon boundary of an H3 cell, expressed as SpatialLite geometry types.
Background
Part of #21 – Basic H3 Cell-Mode Support in SpatialLite.
This is the inverse of LatLngToCell. For a given cell index:
- Decode the index to face-centered IJK coordinates
- Compute boundary vertices in IJK space (6 for hexagons, 5 for pentagons)
- Convert each vertex back to lat/lng
Tasks
- Implement H3 index → face-IJK decoding (inverse of the LatLngToCell encoding)
- Implement IJK → lat/lng vertex computation for hexagon and pentagon cells
- Return boundary as
IReadOnlyList<Coordinate> (or Polygon) compatible with SpatialLite geometry model
- Handle pentagon cells (5 vertices)
- Handle cells that cross the anti-meridian (180° longitude)
Acceptance Criteria
- Returns correct boundary coordinates for hexagonal cells at all resolutions 0–15
- Pentagon cells return 5 vertices; regular hexagons return 6 vertices
- Anti-meridian crossing is handled correctly
- Return type integrates with the SpatialLite geometry model
- Behavior verified against upstream H3 test vectors
Summary
Implement
CellToBoundarywhich returns the geographic polygon boundary of an H3 cell, expressed as SpatialLite geometry types.Background
Part of #21 – Basic H3 Cell-Mode Support in SpatialLite.
This is the inverse of
LatLngToCell. For a given cell index:Tasks
IReadOnlyList<Coordinate>(orPolygon) compatible with SpatialLite geometry modelAcceptance Criteria