Live data from Hacker News

H3: Uber’s Hexagonal Hierarchical Spatial Index (2018)

eng.uber.com

11–20 of 76 posts

Re: H3: Uber’s Hexagonal Hierarchical Spatial Index (2018)

#14
post #3

I'd be curious to see a more thorough comparison to S2, which IMHO seems simpler (it's just quadtrees) and likely faster (it supports O(1) lookup vs. needing a hierarchical search).

The critical advantage of h3 vs. s2 is that all neighbors are equidistant from the central cell. Also, the implementation of the projection means there is less distortion than s2.

I use this library every day and absolutely love it.

Re: H3: Uber’s Hexagonal Hierarchical Spatial Index (2018)

#15
post #3

I'd be curious to see a more thorough comparison to S2, which IMHO seems simpler (it's just quadtrees) and likely faster (it supports O(1) lookup vs. needing a hierarchical search).

H3 and S2 are kinda similar, except by using hexagons, H3 grid centroids are equidistant - rectangles have different distances from center to center.

H3 also has efficient means for finding a cell’s neighbors, and comes with some nice algorithms - like the “compact” fill. See https://uber.github.io/h3/#/documentation/overview/use-cases

The hierarchical search data is built into a grid’s ID in both H3 and S2, which helps when comparing ID’s to see how close they are to each other.

For visualization, I prefer the way H3 looks over S2. While that’s just an opinion, H3 grid is exposed directly to drivers and in lots of tools.

I work for Uber and have used H3, but don’t work on the library.

Re: H3: Uber’s Hexagonal Hierarchical Spatial Index (2018)

#16
post #5

H3 is working for the specific Ubers’ needs. Not much useful as S2.

I wish you weren't downvoted, this is exactly right.

The nice thing about S2 is that is subdivides cleanly: A square can be composed of smaller squares while hexagons can't be. This property makes S2 much more broadly useful for a bigger range of applications.

In H3, each hierarchical level of hexagon doesn't fit cleanly in the one below. For Uber's uses, this is acceptable because hexagons have more uniform adjacency but the "zoom in and out" math is pretty gnarly.

But even S2 had the funkyness of first mapping a sphere to a cube. They're both fairly interesting to read up on.

Re: H3: Uber’s Hexagonal Hierarchical Spatial Index (2018)

#17
post #15
post #3

I'd be curious to see a more thorough comparison to S2, which IMHO seems simpler (it's just quadtrees) and likely faster (it supports O(1) lookup vs. needing a hierarchical search).

H3 and S2 are kinda similar, except by using hexagons, H3 grid centroids are equidistant - rectangles have different distances from center to center. H3 also has efficient means for finding a cell’s neighbors, and comes with some nice algorithms - like the “compact” fill. See https://uber.github.io/h3/#/documentation/overview/use-cases The hierarchical search data is built into a grid’s ID in both H3 and S2, which he…

> For visualization, I prefer the way H3 looks over S2. While that’s just an opinion, H3 grid is exposed directly to drivers and in lots of tools.

Ah, yes this makes a lot of sense. The video in the link actually does have a nice comparison at 17:30, where this is called out. It seems to me to be the most compelling argument for hexagons.

Re: H3: Uber’s Hexagonal Hierarchical Spatial Index (2018)

#18
post #14
post #3

I'd be curious to see a more thorough comparison to S2, which IMHO seems simpler (it's just quadtrees) and likely faster (it supports O(1) lookup vs. needing a hierarchical search).

The critical advantage of h3 vs. s2 is that all neighbors are equidistant from the central cell. Also, the implementation of the projection means there is less distortion than s2. I use this library every day and absolutely love it.

Thanks for sharing. What do you use it for? Did you use S2 previously?

Re: H3: Uber’s Hexagonal Hierarchical Spatial Index (2018)

#20
post #3

I'd be curious to see a more thorough comparison to S2, which IMHO seems simpler (it's just quadtrees) and likely faster (it supports O(1) lookup vs. needing a hierarchical search).

>it supports O(1) lookup vs. needing a hierarchical search

Bear in mind that H3 only has 16 levels of resolution, so traversing from top level down to the square-metre level is still a constant time operation i.e. O(16)

Post reply on HN