There is a lot of literature on join operations using discrete global grid systems (DGGS). H3 is a widely used DGGS optimized for visualization. If joins are a critical performance-sensitive operation, the most important property of a DGGS is congruency . H3 is not congruent it was optimized for visualization, where congruency doesn’t matter, rather than analytical computation. For example, the article talks about de…
> If joins are a critical performance-sensitive operation, the most important property of a DGGS is congruency. Not familiar with geo stuff / DGGS. Is H3 not congruent because hexagons, unlike squares or triangles, do not tile the plane perfectly? I mean: could a system using hexagons ever be congruent?
Making geo joins faster with H3 indexes
31–40 of 70 posts
Re: Making geo joins faster with H3 indexes
#32Earlier quoted context omitted.
The big reason is that H3 is data independant. You put your data in predefined bins and then join on them, whereas kd/r trees depend on the data and building the trees may become prohibitive or very hard (especially in distributed systems).
Indices are meant to depend on the data yes, not exactly rocket science. Updating an R-tree is log(n) just like any other index.
This is all speculation, but intuitively your criticism makes sense.
Also, mapping 147k cities to countries should not take 16 workers and 1TB of memory, I think the example in the article is not a realistic workload.
Re: Making geo joins faster with H3 indexes
#33Ohh, every geo join/spatial thing with picture that consists of those small cells over map is such pet peeve of mine. Facebook marketplace, craigslist, tinder, any app with “proximity search”. No, this city isn’t 4 miles from my city. There is a literal lake between us. It’s 10+ miles. Please, invent something, do precompute, but just avoid naive-ish searches.
Is this related to the article?
Re: Making geo joins faster with H3 indexes
#34Earlier quoted context omitted.
Beware that the parent hexagon does not contain its children...
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.
Re: Making geo joins faster with H3 indexes
#35Re: Making geo joins faster with H3 indexes
#36Earlier quoted context omitted.
The big reason is that H3 is data independant. You put your data in predefined bins and then join on them, whereas kd/r trees depend on the data and building the trees may become prohibitive or very hard (especially in distributed systems).
Indices are meant to depend on the data yes, not exactly rocket science. Updating an R-tree is log(n) just like any other index.
Not rocket science but different tradeoffs, that’s what engineering is all about.
Re: Making geo joins faster with H3 indexes
#37Re: Making geo joins faster with H3 indexes
#38Earlier quoted context omitted.
Yes. And it should be faster. They may forget to create spatial index.
Agree with this. They are re-solving a problem that has been solved better by others before (with R-trees). They may well be using some data storage where spatial indexing is not possible or standard. Geoparquet is a common one now - a great format in many ways but spatial indexing isnt there. Postgres may be out of fashion but still an old fashioned postgis server is the simplest solution sometimes.
Re: Making geo joins faster with H3 indexes
#39We do something similar for some limited geospatial search using elastic search. We make a set of h3 indexes for each of the hundreds of millions of gps recordings on our service, and store them in elastic search. Geospatial queries become full text search queries, where a point is on the line if the set of h3 indexes contains the point. You can do queries on how many cells overlap, which lets you match geospatial tr…
Does this effect writes negatively?
Re: Making geo joins faster with H3 indexes
#40We do something similar for some limited geospatial search using elastic search. We make a set of h3 indexes for each of the hundreds of millions of gps recordings on our service, and store them in elastic search. Geospatial queries become full text search queries, where a point is on the line if the set of h3 indexes contains the point. You can do queries on how many cells overlap, which lets you match geospatial tr…
Elastisearch and Opensearch have a built in geo_shape type that is a bit more optimal for queries like this. Before that existed (pre 1.0 actually), I did something similar with geohashes, which are similar to h3 but based on simple string encoded quad trees. I indexed all the street segments in openstreetmap with that (~800 million at the time) and implemented a simple reverse geocoder. Worked shockingly well. The g…