Live data from Hacker News

Show HN: A5

github.com

11–20 of 31 posts

Re: Show HN: A5

#13

H3 and S2 are supported out of the box in ClickHouse and have reference libraries in C and C++. But it looks like A5 only has a reference implementation in TypeScript. Porting would not be a problem, though...

Bear in mind that this is a "Show HN", the library was released just a few weeks ago! Whereas the other libraries have been around for a decade+

The plan is certainly to release versions in other languages, if you would like to be involved, please get in touch. I agree the porting shouldn't be too difficult, as by design the library has just one simple dependency and the code should translate nicely to other C-style languages

Re: Show HN: A5

#14
post #2

Can you give some examples of when this might be better to use than H3? The ones that seem obvious: - You need very high resolution. H3 is also 64 bit I think, but it seems like A5 highest resolution is about 4 orders of magnitude higher. - Equal cell size: are the cells exactly equal in size (in m2)? H3 they vary by up to ~2x. What are the downsides? The shapes are irregular, distances between centroids are not unif…

Yes, those are the obvious ones. This example: https://a5geo.org/examples/airbnb shows why the equal area is valuable in practice, while https://a5geo.org/examples/area shows the area variation vs h3. The downsides are the characteristics that make h3 or s2 useful. For h3, the single neighbor type means it is well suited to flow analysis and S2 having exact cell subdivision means it is great for simplifying geometry.…

Very cool, thanks for the insight

Re: Show HN: A5

#15
> The benefit of choosing a dodecahedron is that it is the platonic solid with the lowest vertex curvature, and by this measure it is the most spherical of all the platonic solids. This is key for minimizing cell distortion as the process of projecting a platonic solid onto a sphere involves warping the cell geometry to force the vertex curvature to approach zero. Thus, the lower the original vertex curvature, the less distortion will be introduced by the projection.

This feels like an uncommon need to optimize for. Can't think of a reason I would reach for this over S2 or H3

Re: Show HN: A5

#16
post #11

What's the advantage of this over HEALPix projection? https://en.wikipedia.org/wiki/HEALPix

The base platonic solid that Healpix is based on is the octahedron (https://en.wikipedia.org/wiki/Octahedron), which A5 uses the dodecahedron(https://en.wikipedia.org/wiki/Regular_dodecahedron).

The octahedron has a much higher angular defect (https://en.wikipedia.org/wiki/Angular_defect) than the dodecahedron, and thus when it is projected onto the sphere the cells are warped a lot. So while their areas may be the same, the shapes vary.

This article explains the geometric construction, and how it leads to the cells being a similar size and shape: https://a5geo.org/docs/technical/platonic-solids

Also from a data visualization point of view, the rectangular cells of Healpix (like S2) are arguably less pleasing to look at than hexagons/pentagons: https://h3geo.org/docs/comparisons/s2#visualization

Re: Show HN: A5

#17
post #15

> The benefit of choosing a dodecahedron is that it is the platonic solid with the lowest vertex curvature, and by this measure it is the most spherical of all the platonic solids. This is key for minimizing cell distortion as the process of projecting a platonic solid onto a sphere involves warping the cell geometry to force the vertex curvature to approach zero. Thus, the lower the original vertex curvature, the le…

If you're aggregating and comparing data across different locations for example: https://a5geo.org/examples/airbnb

Re: Show HN: A5

#18
post #11

What's the advantage of this over HEALPix projection? https://en.wikipedia.org/wiki/HEALPix

I'm not sure about A5, but I do know that HEALPix cell boundaries are not geodesics, whereas S2 cells are always bounded by four geodesics.

Re: Show HN: A5

#19
post #11

What's the advantage of this over HEALPix projection? https://en.wikipedia.org/wiki/HEALPix

I'm not sure about A5, but I do know that HEALPix cell boundaries are not geodesics, whereas S2 cells are always bounded by four geodesics.

A5 cell boundaries are geodesics. One more difference that I thought of is that HEALPix is generally not aligned with the continents (makes sense as it is mostly used for astrophysics), whereas the hilbert curve used to index A5 is aligned with the continental land masses: https://a5geo.org/examples/globe

As a result, when A5 is used as a spatial index, it will generally not have jumps in the cell index values when querying nearby locations on land

Post reply on HN