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.
Summary
Adds the geodesic traversal mode to
polygonToCellsExperimental
, letting us follow true great-circle edges when filling massive polygons (think continental footprints and polar caps). The PR builds the geodesic stack from the ground up—new vector math helpers, bounding caps, iterator wiring, and plenty of validation coverage—while keeping the default planar behavior unchanged (and safely rejecting geodesic flags on the legacy API).Highlights
New geodesic mode
FLAG_GEODESIC_MASK
(with helpers) so callers can opt into geodesic coverage; validates acceptable containment modes (FULL
,OVERLAPPING
) at bothmaxPolygonToCellsSizeExperimental
andpolygonToCellsExperimental
.Core geometry plumbing
GeodesicPolygon
acceleration structures + helpers (geodesicPolygonCreate/Destroy
, containment, boundary/cap intersection tests).latLngToVec3
, cross/dot/normalize, distance helpers) and new conversions:vec3dToCell
,cellToVec3
,cellToGeodesicBoundary
,cellToSphereCap
.sphereCapTables.h
for both prod code and tests; exposesSphereCap
/AABB
helpers.Iterator & polyfill updates
polyfill_iterator.h
(with_extra
context) and wires ingeodesic_iterator.c
.polygonToCells
path.Benchmarks, fuzzers, and tests
testGeodesicPolygonToCellsExperimental
,testSphereCap
,testVec3d
, plus extendedtestBBoxInternal
,testPolygonToCells(Experimental)
flag validation, and memory-failure coverage.CMakeLists.txt
/CMakeTests.cmake
.Documentation
Attribution
This geodesic polyfill work originated at Yellowbrick Data (where I’m currently employed). We’re upstreaming it to the H3 project so the broader community can benefit and use it for coverage.