Uber has open sourced a global indexing system called H3 that uses a hexagonal hierarchical spatial index. H3 can be used with bindings in python, javascript, java, and go. The document then discusses topology, cell complexes, Euler characteristic, differential geometry, curvature of polygons and links, Gauss-Bonnet theorem, and how the dual graph of a tessellation of hexagons on a sphere results in an almost perfect triangulation.
REVISTA DE BIOLOGIA E CIÊNCIAS DA TERRA ISSN 1519-5228 - Artigo_Bioterra_V24_...
Uber’s Hexagonal Hierarchical Spatial Index Explained
1.
2. H3: Uber’s Hexagonal Hierarchical Spatial Index
● Uber has open sourced a global indexing system called H3
You can find it here https://github.com/uber/h3, Can be used with bindings in
python, js, java, go
● You can go here https://eng.uber.com/h3/ for details on why they decided on hexagons
4. Some Topology: Cell Complexes
OK, so this may look scary, but all it’s saying is, start with a
collection of points, then build a collection of lines by joining points,
Then build a collection of faces by joining lines and so on, we are
only concerned with 2 cell complexes, so we can stop at faces
11. Curvature of the polygons
Let’s say all angles should be 2 * PI / 3 = 60 degrees
And at every point three polygons meet, then
k(pentagon) = 5 * 2 * PI / 3 - (5 - 2) * PI = PI / 3
k(hexagon) = 6 * 2 * PI / 3 - (6 - 2) * PI = 0 (COOL!)
12. Curvature of links
2 * PI - PI * (3 edges - 3 vertices) - 3 * 2 * PI / 3 = 0 (also cool)
13. Gauss Bonnet
Sum k(pentagon) + sum k(hexagon) + sum links = 2 PI * Euler
Euler of a sphere is 2 so , since sum k(hexagon) = sum links = 0
We get
Sum k(pentagon) = 4 * PI = number of Pentagons * PI / 3
Number of pentagons = 12
And number of hexagons = however many we want (Super cool)
15. SOOOO,
The dual graph to our cool hexagon tiling of the sphere is almost a perfect
Triangulation.
What’s perfect? Well equilateral triangles are kind of perfect no?
And the ones that arent (12 * 5 = 60) are isoceles whoses odd angle out
Have angles 2 * PI / 5 which is almost 60 degrees anyway
16. But Wait don’t triangles suck?
Not when we want to interpolate, that’s where they shine, and which ones shine
the brightest?