Public
Edited
Oct 16, 2022
3 forks
22 stars
Also listed in…
H3
Insert cell
Insert cell
Insert cell
// Index a lat/lng point to an H3 index
h3.geoToH3(20, 123, 2)
Insert cell
// Get the center of an H3 index as a lat/lng point
h3.h3ToGeo("8928342e20fffff")
Insert cell
// Get the vertices of an H3 index as lat/lng points
h3.h3ToGeoBoundary("8928342e20fffff")
Insert cell
Insert cell
// Get the children of an H3 index at the given (finer) resolution
h3.h3ToChildren("8928342e20fffff", 10)
Insert cell
// Get the parent of an H3 index at the given (coarser) resolution
h3.h3ToParent("8928342e20fffff", 7)
Insert cell
Insert cell
// Find all H3 indexes within a given distance from the origin (filled ring)
h3.kRing("8728342e2ffffff", 1)
Insert cell
// Find all H3 indexes a specific distance from the origin (hollow ring)
h3.hexRing("8728342e2ffffff", 1)
Insert cell
// Get the distance in grid cells between two H3 indexes
h3.h3Distance("8728342e6ffffff", "8728342c4ffffff")
Insert cell
Insert cell
// Get all H3 indexes within a geographic polygon
h3.polyfill([[[37,-122], [36, -121], [36, -123]]], 5)
Insert cell
// Get the multipolygon (array of polygons) for a set of H3 indexes
h3.h3SetToMultiPolygon(["85291a6ffffffff", "85291a6bfffffff", "852834d3fffffff"])
Insert cell
Insert cell
Insert cell
Insert cell

Purpose-built for displays of data

Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Learn more