From 5f2ba4adc184353d1d09132f7f745725eb3de333 Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 20 Oct 2026 06:07:19 +0000 Subject: [PATCH] Add H3 hexagons page: the globe on H3's icosahedron, unfolded 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) Claude-Session: https://claude.ai/code/session_01C26PdyCsHmEvoKvZYwrMJA --- README.md | 23 ++ aatgrid.html | 2 +- affine.html | 2 +- bins.html | 2 +- catastrophes.html | 2 +- cells.html | 2 +- cones.html | 2 +- ellipsoid.html | 2 +- example.html | 2 +- geoid.html | 2 +- globals.html | 2 +- grids.html | 2 +- h3.html | 132 +++++++++++ homage.html | 2 +- hull.html | 2 +- index.html | 2 +- indexspace.html | 2 +- js/h3.js | 534 +++++++++++++++++++++++++++++++++++++++++++ nuyina.html | 2 +- ortho.html | 2 +- package-lock.json | 15 +- package.json | 3 +- rasterize.html | 2 +- regular.html | 2 +- rhumb.html | 2 +- sentinel.html | 2 +- spilhaus.html | 2 +- src/core/icosa.js | 165 +++++++++++++ src/core/index.js | 1 + structure.html | 2 +- test/check-icosa.mjs | 74 ++++++ texture.html | 2 +- tissot.html | 2 +- vicgrid.html | 2 +- 34 files changed, 971 insertions(+), 28 deletions(-) create mode 100644 h3.html create mode 100644 js/h3.js create mode 100644 src/core/icosa.js create mode 100644 test/check-icosa.mjs diff --git a/README.md b/README.md index ba3e1c7..cd9f989 100644 --- a/README.md +++ b/README.md @@ -290,6 +290,27 @@ checked against s2sphere in `test/fixtures/s2-cells.json`. Hash keys: `lvl` (0 to 12), `t` (unfold, 0 globe, 0.5 cube, 1 net), `cell` (a token), `curve`, `grid`, `coast`, `uvgrid`, `cam`. +## H3 hexagons + +`h3.html` puts [H3](https://h3geo.org/), Uber's hexagonal grid, on the +icosahedron it is built on. A light at the centre of the globe casts every +point onto one of twenty faces (the gnomonic projection, twenty times), and +on each face's plane H3's hexagons are exactly regular. "Unfold" swells the +globe to the icosahedron (placed as Fuller placed it for the Dymaxion map, +every corner in the ocean) and opens it into the strip net. The twelve +pentagons, one at each corner, are outlined at every resolution; "Children" +shows the seven children of the picked cell spilling over its edge, and the +19.1 degree turn between Class II and Class III resolutions. + +Click a cell for its index, resolution, base cell, faces and area, or paste +an index. Parent and Child step through resolutions 0 to 15; GeoJSON copies +the cell. The cells come from [h3-js](https://github.com/uber/h3-js) 4.4.0 +(from jsDelivr); `src/core/icosa.js` builds the icosahedron from H3's twelve +pentagons, its gnomonic face frames and the hinges of the net, checked +against h3-js in `test/check-icosa.mjs`. Hash keys: `res` (0 to 3), `t` +(unfold, 0 globe, 0.5 icosahedron, 1 net), `cell` (an H3 index), `grid`, +`kids`, `coast`, `col` (`base`, `digit`, `none`), `bm`, `cam`. + ## MGRS and Sentinel-2 `sentinel.html` shows UTM as one transverse Mercator cylinder laid on its @@ -817,6 +838,7 @@ spilhaus.html, js/spilhaus.js Spilhaus page globals.html, js/globals.js globals and interrupteds page catastrophes.html, js/catastrophes.js map catastrophes page cells.html, js/cells.js s2 cells page +h3.html, js/h3.js H3 hexagons on the icosahedron grids.html, js/grids-page.js model grids page indexspace.html, js/indexspace.js index space page structure.html, js/structure-page.js tiles and overviews page @@ -863,6 +885,7 @@ src/core/geotiff-write.js GeoTIFF writer with user-defined CRS keys src/core/cellexport.js GeoTIFF of one cell, tile or lobe in its own CRS src/core/mishaps.js catastrophe steps, vertex-by-vertex and spherical drawing src/core/s2.js S2 faces, cell ids and tokens, from s2geometry +src/core/icosa.js icosahedron from 12 vertices, gnomonic face frames, strip net hinges src/core/roms.js ROMS s-coordinate, synthetic grids and data, Zarr grid reader src/core/regular.js which CRS makes a lon/lat array regular; example grids; geos scan angles src/core/structure.js grid, tile and file structure of COG, Zarr, WMTS, ArcGIS, XYZ and specs diff --git a/aatgrid.html b/aatgrid.html index 68f6208..b90d804 100644 --- a/aatgrid.html +++ b/aatgrid.html @@ -28,7 +28,7 @@