Remix.run Logo
mattrighetti 3 days ago

TIL! What are the advantages of hexagonal spatial indexing compared to e.g. quad trees, r-trees?

ashergill 3 days ago | parent | next [-]

The main advantages of hexagons are that the distance to each neighbour is always the same, and the distortion across the globe is much less, because of the way H3 creates its grid (compared to the earlier Google S2 which uses squares and distorts a lot). There’s an excellent Uber blog post about this, I’ll see if I can find the link.

ashergill 3 days ago | parent [-]

(here’s the blog post: https://www.uber.com/en-GB/blog/h3/ )

serjester 3 days ago | parent | prev | next [-]

One of the big ones that hasn't been mentioned is all of a hexagon's neighbors are equidistant. As a result, h3 is a better fit for flow modeling - stuff like telematics. This has some nice properties for ML too.

You can see one of my jupyter notebooks that dives deep into this with h3 here: https://drive.google.com/file/d/18jIVEbE_1QbwTbHdMqj0AVqguf2...

jandrewrogers 3 days ago | parent | prev [-]

The main advantage of hexagonal spherical tiling systems is that they are roughly equal area at a given resolution. This makes them particularly suitable for generating visualizable aggregates when you primarily care about spatial distribution rather than specific boundaries (like borders).

The main disadvantage of non-congruent tiling systems like H3 is poor scalability and performance when running analytical computations. In most cases you wouldn't want to shard your underlying data this way even if this is how you want to visualize it.

It is easy to get the best of both worlds. You can shard data models as 3-space spherical embeddings (efficient for large-scale analytic computation) and convert query results to an H3 tiling at wire speed on demand.

pheelicks 2 days ago | parent [-]

It is a common misconception that h3 is equal area. At any resolution level the cell size varies by a factor of 2, which is (roughly) the same as S2.

See the following visualizations for an illustration:

https://a5geo.org/examples/area

https://a5geo.org/examples/airbnb

jandrewrogers 2 days ago | parent [-]

Note that I wrote “roughly equal area”. True equal area doesn’t exist. I am on record that for analytical purposes, equal area largely doesn’t matter.