Platform
Resources
Pricing
Sign in
Contact us
Nick Rabinowitz
Workspace
Fork
Public
2 collections
By
Nick Rabinowitz
Edited
May 20, 2024
ISC
Fork of
H3 Tutorial: Intro to h3-js (v3)
•
2 forks
9 stars
H3 Tutorials
H3 Tutorial: Intro to h3-js (v3)
H3 Tutorial: Intro to h3-js (v4)
H3 Tutorial: Rendering Hexagons
H3 Tutorial: Using Point Layers
H3 Tutorial: Using Polygon Layers
H3 Tutorial: Suitability Analysis
H3 Radius Lookup
Also listed in…
H3
Insert cell
Insert cell
Insert cell
// Index a lat/lng point to an H3 index
h3
.
latLngToCell
(
20
,
123
,
2
)
Insert cell
// Get the center of an H3 index as a lat/lng point
h3
.
cellToLatLng
(
"8928342e20fffff"
)
Insert cell
// Get the vertices of an H3 index as lat/lng points.
// Passing "true" as the second parameter yields GeoJSON lng/lat points and a closed loop.
h3
.
cellToBoundary
(
"8928342e20fffff"
,
true
)
Insert cell
Insert cell
// Get the children of an H3 index at the given (finer) resolution
h3
.
cellToChildren
(
"8928342e20fffff"
,
10
)
Insert cell
// Get the parent of an H3 index at the given (coarser) resolution
h3
.
cellToParent
(
"8928342e20fffff"
,
7
)
Insert cell
Insert cell
// Find all H3 indexes within a given distance from the origin (filled ring)
h3
.
gridDisk
(
"8728342e2ffffff"
,
1
)
Insert cell
// Find all H3 indexes within a given distance from the origin, grouped into hollow rings
// from innermost to outermost
h3
.
gridDiskDistances
(
"8728342e2ffffff"
,
3
)
Insert cell
// Get the distance in grid cells between two H3 indexes
h3
.
gridDistance
(
"85283473fffffff"
,
"8528362bfffffff"
)
Insert cell
// Get a path of cells between two H3 indexes
h3
.
gridPathCells
(
"85283473fffffff"
,
"8528362bfffffff"
)
Insert cell
Insert cell
// Get all H3 indexes within a geographic polygon. Inclusion is determined by whether the center
// of a given cell falls within the polygon.
h3
.
polygonToCells
(
[
[
[
37
,
-
122
]
,
[
36
,
-
121
]
,
[
36
,
-
123
]
]
]
,
5
)
Insert cell
// Get the multipolygon (array of polygons) for a set of H3 indexes. Indexes are expected to
// be unique and all at the same resolution
h3
.
cellsToMultiPolygon
(
[
"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.
Try it for free
Learn more
Compare fork
Fork
View
Export
Listed in...
H3
Nick Rabinowitz
H3 Tutorials
Nick Rabinowitz
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
h3
Edit
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML