3 ms·
For comparison, Google uses S2 cells in their maps, which is a tiling of quadrilaterals formed by projecting a cube onto a sphere, with a clever addressing syst
by splonk 8y ago
For comparison, Google uses S2 cells in their maps, which is a tiling of quadrilaterals formed by projecting a cube onto a sphere, with a clever addressing system. Here's a good summary of how those work: http://s2geometry.io/devguide/s2cell_hierarchy.html http://s2geometry.io/devguide/s2cell_hierarchy.html
I'm not an expert on this, but off the top of my head I can see a couple obvious tradeoffs. I'd love to hear some feedback from someone who's worked with H3 and S2 about the differences.
- S2 cells end up being sort of diamond shaped and all oriented in the same direction after being projected onto a sphere, so their radius varies a lot more than an H3 cell. I wouldn't be surprised if H3 cells are on average more useful for doing local data analysis, since they're closer to a circle. For example, a collection of events are probably clustered together more in an H3 cell than an equivalently sized S2 cell.
- S2 cells tile perfectly - each one is comprised of 4 smaller S2 cells. An H3 cell is approximated by 7 smaller H3 cells.
- Related to above, S2 cell addresses are in some sense "strict" - you can cut off the lowest significant bit to get the address of the parent S2 cell, which will fully contain the child cell. An H3 cell is not necessarily fully contained by its parent cell - judging by the pictures, the center cell is, but the 6 edge cells will overlap a bit. Probably the H3 cells are more annoying to work with for certain cases requiring exact numbers.
- As mentioned in the writeup, H3 needs to include a few pentagons in their tiling. They mention that they're oriented the grid so that the pentagons are over water, so it's probably not a big deal in day to day work.
- malandrew 8y agoThat's the jist of it. h3 cells have the benefit of no boundary conditions as all neighbor edges are the same shape and you can only cross boundaries. With s2, the problem is that four edges are long and then there are four vertices you can cross to get into the adjacent diamonds at each corner. The tradeoff is what you described, s2 cells nest perfectly at different resolutions, but h3 cells are only approximate. They are both great tools useful in different circumstances. It you have to move between resolutions and don't care about movement between cells, s2 is a better choice. If you care only about one resolution for your work or care about movement/flow between neighboring cells, h3 is a better choice. s2 I believe also goes down to a smaller resolution (like 1 cm or so) and h3 goes down to like 1 meter. That said, there aren't many use cases that need greater than 1-meter resolution.