3 ms·
TIL! What are the advantages of hexagonal spatial indexing compared to e.g. quad trees, r-trees?
by mattrighetti 11mo ago
TIL! What are the advantages of hexagonal spatial indexing compared to e.g. quad trees, r-trees?
- ashergill 11mo agoThe 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 11mo ago(here’s the blog post: https://www.uber.com/en-GB/blog/h3/ https://www.uber.com/en-GB/blog/h3/ )
- jandrewrogers 11mo agoThe 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 11mo agoIt 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/area https://a5geo.org/examples/airbnb https://a5geo.org/examples/airbnb
- jandrewrogers 11mo agoNote 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.
- serjester 11mo agoOne 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_1QbwTbHdMqj0AVqguf2Vrtrc/view?usp=sharing https://drive.google.com/file/d/18jIVEbE_1QbwTbHdMqj0AVqguf2...