feat: add pure-Go regions (polygon/cells, multipolygon) to x/h3go#130
Open
justinhwang wants to merge 1 commit into
Open
feat: add pure-Go regions (polygon/cells, multipolygon) to x/h3go#130justinhwang wants to merge 1 commit into
justinhwang wants to merge 1 commit into
Conversation
Implements the full H3 regions API in pure Go, verified against the cgo reference: - PolygonToCells (legacy flood-fill polyfill) and GeoPolygon.Cells, with the GeoPolygon/GeoLoop types, bounding-box helpers, and a ray-casting point-in-polygon test. - PolygonToCellsExperimental with the ContainmentMode options (center, full, overlapping, overlapping-bbox): a hierarchical traversal of the cell grid exposed as a native iter.Seq, with cellToBBox (res-0, pole, and edge-length tables), bbox overlap/contains/scale/normalization, and cell-boundary intersection tests. - CellsToMultiPolygon via the arc/union-find outline algorithm, assembling cell sets into polygons (outer loop plus holes) ordered by area, including the eight-triangle globe representation for a fully covered set. A Go map replaces the C hash table, which only accelerates lookup without affecting the result. Verified against the cgo reference as sets across many polygons, all containment modes, resolutions, and cell sets (blobs, rings, disjoint regions, pentagons, the whole globe), plus error parity. 100% per-package statement coverage by in-package tests. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Coverage Report for CI Build 27727545624Coverage at 100.0% (no base build to compare)Details
Uncovered ChangesNo uncovered changes found. Coverage RegressionsNo coverage regressions found. Coverage Stats
💛 - Coveralls |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Implements the full H3 regions API in pure Go, verified against the cgo reference:
Verified against the cgo reference as sets across many polygons, all containment modes, resolutions, and cell sets (blobs, rings, disjoint regions, pentagons, the whole globe), plus error parity. 100% per-package statement coverage by in-package tests.