Repository navigation
Add H3 hexagons page: the globe on H3's icosahedron, unfolded - #55
Merged
Merged
Conversation
h3.html puts H3 cells (from h3-js 4.4.0) on the icosahedron built from H3's own twelve pentagons: globe to icosahedron (gnomonic per face) to strip net, with the pentagons, a picked cell's family (parent, seven children, neighbours) on a gnomonic plane, GeoJSON and a GeoTIFF of the cell. src/core/icosa.js builds the faces, gnomonic frames and net hinges; test/check-icosa.mjs checks them against h3-js. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01C26PdyCsHmEvoKvZYwrMJA
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.
Requested by Michael · project thread
Before: the cells group had S2 (cube), MGRS, L3 bins and AAT, but no icosahedral DGGS.
After: a new "H3 hexagons" tab after s2 cells. The globe unfolds onto H3's icosahedron (gnomonic per face) and then opens into the strip net (5 / 10 / 5). The twelve pentagons are outlined at every resolution, and cells can be coloured by base cell or by last digit. Click a cell, or paste an index, to see its family drawn on a gnomonic plane about its centre: the parent (dashed), the seven children with their digits, the 49 grandchildren and the neighbours. That shows aperture 7, the children spilling past the parent's edge, and the Class II/III turn, at any resolution from 0 to 15. Parent/Child, GeoJSON and a GeoTIFF of the cell (gnomonic about its centre) work as on the s2 page.
How: the cells come from h3-js 4.4.0 (jsDelivr importmap; also a devDependency for the test).
src/core/icosa.js(pure core) builds the icosahedron from H3's twelve pentagon centres, renumbers the faces as H3 does, and provides the gnomonic face frames, the strip net and the hinge unfolding.test/check-icosa.mjschecks the face lookup againstgetIcosahedronFaceson 3000 points, checks that H3 hexagons are regular on each face plane (to 1e-13), and checks that the net is flat, equilateral and doesn't overlap. The globe grid is capped at resolution 3 (41k cells), because resolution 4 was too slow to draw on canvas. Nav links were added to every page, and the README has been updated.Credits on the page: H3 (Brodsky and others, Uber), Sahr, White and Kimerling (2003) for aperture and class, and Fuller for the icosahedron placement.
Generated by Claude Code