Live data from Hacker News

Harder, Better, Faster, Stronger Version of Uber H3 in Rust

grim7reaper.github.io

21–30 of 43 posts

Re: Harder, Better, Faster, Stronger Version of Uber H3 in Rust

#21

I never understood why anyone would prefer the H3 hex tiles over Google’s much simpler S2 system: http://s2geometry.io/ Sure, hex tiles make certain circular nearest neighbour searches slightly more accurate… but still have an error. And then… everything else that’s inconvenient with hex tiling, like that issue that subdivisions of a cell leak into the neighbouring cells and hence don’t add up to 100% of the parent!…

They have a page about pros and cons: https://h3geo.org/docs/comparisons/s2/

For my use case, the visual distortion of S2 was quite a no-go.

As for DB queries, it really depends on your use case and how you store your data, but you can get some good results. But yeah, if you really need exact parent-child containment, S2 is easier to work with.

Re: Harder, Better, Faster, Stronger Version of Uber H3 in Rust

#22

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

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.

Re: Harder, Better, Faster, Stronger Version of Uber H3 in Rust

#23

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

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.

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

Re: Harder, Better, Faster, Stronger Version of Uber H3 in Rust

#24

Author here! Funny to see this on the front page xD That was the blog post for the initial release, and a lot of things have changed since then (definitely deserves a new blog post ^^). The first big change happened six months after the release, when I rewrote most of the geometrical algorithms (leveraging the excellent geo crate) and got a massive boost in speed and reduction in memory usage which made it applicable…

Very impressive results, cool to see innovation in this space! I’d definitely be interested in a follow up post going into the details of the geometric algorithms. I’m working on my own DGGS, A5, the first (and only) to use pentagons. It offers true equal area cells and a much higher cell fidelity (below 1cm compared to 1m for H3). I’m looking for contributors to get involved and you seem to have the perfect skill se…

Ha, yeah, I remember reading about your project back in April (I think someone shared it on the GeoRust Discord). Really cool stuff you have here!

Can't say I understand all the math behind it, as it's not my forte (even for H3, for the more numerical parts, I rely on the work of the original authors: I could never have come up with this myself), but your doc is really great!

For the follow-up article, I hope I can get to it eventually. But spare time is a rare currency ^^

Re: Harder, Better, Faster, Stronger Version of Uber H3 in Rust

#25

I never understood why anyone would prefer the H3 hex tiles over Google’s much simpler S2 system: http://s2geometry.io/ Sure, hex tiles make certain circular nearest neighbour searches slightly more accurate… but still have an error. And then… everything else that’s inconvenient with hex tiling, like that issue that subdivisions of a cell leak into the neighbouring cells and hence don’t add up to 100% of the parent!…

H3 is preferred for geo analytics because it produces a more uniform spatial index with low distortion and consistent distances between cells

Its primary use case was efficient spatial aggregation for applications like pricing, demand forecasting, positioning etc.

Re: Harder, Better, Faster, Stronger Version of Uber H3 in Rust

#26

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

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.

Re: Harder, Better, Faster, Stronger Version of Uber H3 in Rust

#27

who is using uber h3 and what for? (besides uber of course)

I’ve used h3 for a game. Since they align with an unique hex, I can ensure that one cell grid aligns and is placed on the same place in the world, where players could then compete on.

[deleted]

Re: Harder, Better, Faster, Stronger Version of Uber H3 in Rust

#28

who is using uber h3 and what for? (besides uber of course)

Overture maps docs use it to visualize the coverage of Overture address data.

https://docs.overturemaps.org/guides/addresses/

Picture url: https://docs.overturemaps.org/assets/images/address-coverage...

Re: Harder, Better, Faster, Stronger Version of Uber H3 in Rust

#29

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

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...

Post reply on HN