Live data from Hacker News

Making geo joins faster with H3 indexes

floedb.ai

61–70 of 70 posts

Re: Making geo joins faster with H3 indexes

#62

Earlier quoted context omitted.

I appreciate the reply! So, I might be wrong here, but I think we may be talking about two different layers. I’m also not very familiar with the literature, so I’d be interested if you could point me to relevant work or explain where my understanding is off. To me, the big selling point of H3 is that once you’re "in the H3 system", many operations don’t need to worry about geometry at all. Everything is discrete. H3…

A DGGS is a specialized spatial unit system that, depending on the design, allows you to elide expensive computation for a select set of operations with the tradeoff that other operations become much more expensive. H3 is optimized for equal-area point aggregates. Congruency does not matter for these aggregates because there is only a single resolution. To your point, in H3 these are implemented as simple scalar coun…

I'd like to hear more about the synthetic part of these three spaces, because S2 works exactly as you say, embedding the 2-sphere in three (cartesian) dimensions. S2 points are always three dimensional.

Re: Making geo joins faster with H3 indexes

#63
post #62

Earlier quoted context omitted.

A DGGS is a specialized spatial unit system that, depending on the design, allows you to elide expensive computation for a select set of operations with the tradeoff that other operations become much more expensive. H3 is optimized for equal-area point aggregates. Congruency does not matter for these aggregates because there is only a single resolution. To your point, in H3 these are implemented as simple scalar coun…

I'd like to hear more about the synthetic part of these three spaces, because S2 works exactly as you say, embedding the 2-sphere in three (cartesian) dimensions. S2 points are always three dimensional.

S2 projects a 2-sphere onto a topologically homeomorphic 2-surface designed to play nicely with discrete representations. It is not a 3-space any more than a 2-sphere is. Most software uses three coordinates organized by a 2-surface DGGS.

DGGS that use 3-space embeddings are topologically 3-dimensional i.e. purely volumetric. They do not interpret the Earth as a 2-surface. In addition to polar coordinates, you must provide a volumetric model of the Earth to compute the DGGS cell. The shard distributions look very different between a 2-surface and a 3-surface. The latter has significantly better properties for large analytical data models but requires more sophisticated storage architectures.

The synthetic 3-space is optimized for two things. You want maximally efficient mapping function from the typical WGS84 geometry into it. Tidy math, basically. Since it is purely internal, the user will never see it, and it doesn't map to anything real, you have latitude to design it to satisfy software engineering objectives as long as it works. Second, the 3-space references are naturally less compact than 2-surface references at the same resolution even though you'll end up with roughly the same number of shards. A lot of effort goes to schemes to compress out the sparseness so that the storage requirements are similar to 2-surface DGGS e.g. how often do you need to represent geometry 1000 km below the Earth's surface?

These DGGS also have the low-key advantage that they natively represent and understand 3-space, not just surface geometry, if you move beyond making flat maps.

Re: Making geo joins faster with H3 indexes

#64

Earlier quoted context omitted.

No idea if they are doing this, but you can use Gosper islands ( https://en.wikipedia.org/wiki/Gosper_curve ) which are close to hexagons, but can be exactly decomposed into 7 smaller copies.

Can Gosper islands tile the sphere though?

Not quite - you need 12 pentagons in a mostly hexagonal tiling of the sphere (and if you're keeping them similar sizes, Gosper-islands force hexagon-like adjacency). I don't think it's possible to tile the sphere using more than 20 exactly identical pieces.

You could get a Gosper-island like tiling starting from H3 by saying that each "Hex" is defined recursively to be the union of its 6/7 parts (stopping at some small enough hexagons/pentagons if you really want). Away from the pentagons, these tiles would be very close to Gosper islands.

Re: Making geo joins faster with H3 indexes

#65
post #54
post #30

Earlier quoted context omitted.

Is this related to the article?

Yes. The pictures with those small grids that ignore highways, rivers and mountains is what bothers me

But that's just a way to explain the algorithm. No one will show that to the users. And they don't ignore anything, those features are inside the hexagons.

Re: Making geo joins faster with H3 indexes

#67
post #62

Earlier quoted context omitted.

I'd like to hear more about the synthetic part of these three spaces, because S2 works exactly as you say, embedding the 2-sphere in three (cartesian) dimensions. S2 points are always three dimensional.

S2 projects a 2-sphere onto a topologically homeomorphic 2-surface designed to play nicely with discrete representations. It is not a 3-space any more than a 2-sphere is. Most software uses three coordinates organized by a 2-surface DGGS. DGGS that use 3-space embeddings are topologically 3-dimensional i.e. purely volumetric. They do not interpret the Earth as a 2-surface. In addition to polar coordinates, you must p…

I'd be curious to hear more about how you do the 2 -> 3 embedding there. In S2 it uses cartesian three space, but points are constrained to be unit magnitude. This has advantage and disadvantages obviously.

Re: Making geo joins faster with H3 indexes

#68
post #23

Earlier quoted context omitted.

None that are well-documented publicly. There are a multitude of DGGS, often obscure, and they are often designed to satisfy specific applications. Most don’t have a public specification but they are easy to design. If the objective is to overfit for high-performance scalable analytics, including congruency, the most capable DGGS designs are constructed by embedding a 2-spheroid in a synthetic Euclidean 3-space. The…

Pointers to the literature please. I don't work in this space but love geometry.

He always comments like this. Never commenting a concrete answer. Just look at his history. Hes been doing this for years. Probably as advertisment for himself or to just feel/show superior.

Re: Making geo joins faster with H3 indexes

#69

Earlier quoted context omitted.

How do you join two datasets using r-trees? In a business setting, having a static and constant projection is critical. As long as you agree on zoom level, joining two datasets with S2 and H3 is really easy.

Spatial indices simply partition your data in N-dimensional space the same way a binary tree does it in 1-dimensional space. The whole advantage over a static partition is that it will allow you to properly deal with data that is irregularly distributed. Those data structures can definitely be merged if that's what you're asking.

This data is indeed not irregularly distributed, in fact the fun thing about geospatial data is that you always know the maximum extent of it.

About your binary tree comment: yes this is absolutely valid, but consider then that binary trees also are a bad fit for distributed computing, where data is often partitioned at the top level (making it no longer a binary tree but a set of binary trees) and cross-node joins are expensive.

Re: Making geo joins faster with H3 indexes

#70

Earlier quoted context omitted.

Can Gosper islands tile the sphere though?

Not quite - you need 12 pentagons in a mostly hexagonal tiling of the sphere (and if you're keeping them similar sizes, Gosper-islands force hexagon-like adjacency). I don't think it's possible to tile the sphere using more than 20 exactly identical pieces. You could get a Gosper-island like tiling starting from H3 by saying that each "Hex" is defined recursively to be the union of its 6/7 parts (stopping at some sma…

> I don't think it's possible to tile the sphere using more than 20 exactly identical pieces.

I was wrong about this (e.g. https://en.wikipedia.org/wiki/Rhombic_triacontahedron). It still seems possible to me that there's a limit to the smallest tile that can tile a unit sphere on its own. (Smallest by diameter as a set of points in R^3).

Post reply on HN