Live data from Hacker News

Hexagonal Grids (2013)

redblobgames.com

31–40 of 47 posts

Re: Hexagonal Grids (2013)

#31
post #29

Very cool! If you like hexagons, and boy do I like hexagons, I recommend also checking out Uber’s Hexagonal Hierarchical Spatial Index https://eng.uber.com/h3/

this uber-h3 has been public for a while, and it brings mixed reaction for me -- it seems like Uber wanted to 'invent' something really cool, as in, the showing off part is every bit as important, or more, than the tech. The reason to point that out is, spatial indexing is one of seriously studied topics in academic geometry. Yes, the classical papers can be a bit much, but there is a reason why they are so -- it rea…

I don't understand.

The events are associated with coordinates and then binned into their containing hexagon at a given resolution.

So if 10 people request a ride in the same hexagon in a given time frame it weights that hexagon according to surge pricing rules.

Re: Hexagonal Grids (2013)

#32
post #6

This is a regular and classic submission IMO. Pops up every few months on HN and is absolutely deserving! We used it as a resource in developing the iOS word game http://hexiledgame.com/

Thanks! Lots of changes since the last time it showed up (2017 I think): faster page load, less JS, better diagrams, more diagrams, better colors, axes legend, more polish, more interactive parts. I wrote about these http://simblob.blogspot.com/2018/04/april-updates-hex-grid-g... and http://simblob.blogspot.com/2018/04/april-updates-iteration....

Re: Hexagonal Grids (2013)

#33
post #18

I used this page so much when creating my HexMap Library for Unity [1] (it's MIT Licensed so I hope its okay to advertise it here). Are there any other pages comparable to redblobgames which covers game related topics in such a engaging way? He really inspired me to step up the effort spent in writing good documentation. [1] https://aurelwu.github.io/

Thanks for your library! I've linked to it from my Hex code implementation guide.

For game related topics, I like http://gameprogrammingpatterns.com/ (book available for purchase, but also freely viewable on the web)

Re: Hexagonal Grids (2013)

#34
post #29

Very cool! If you like hexagons, and boy do I like hexagons, I recommend also checking out Uber’s Hexagonal Hierarchical Spatial Index https://eng.uber.com/h3/

this uber-h3 has been public for a while, and it brings mixed reaction for me -- it seems like Uber wanted to 'invent' something really cool, as in, the showing off part is every bit as important, or more, than the tech. The reason to point that out is, spatial indexing is one of seriously studied topics in academic geometry. Yes, the classical papers can be a bit much, but there is a reason why they are so -- it rea…

I just want to make it clear that there's a real reason behind H3, not just "invent something really cool." I don't work at Uber, anymore, but I did work on the team that originated H3 and worked on H3.

To condense it down to a few bullet points, we realized:

1. We needed to move from geofences to a grid for both data science reasons and scaling reasons to perform realtime aggregated and anonymized activity analysis for things like surge pricing.

2. With a grid along with quantized time ranges (eg 10 seconds or 1 minute intervals) we can reduce data collection to distributed increments across a small cluster of machines with O(1) compute time rather than a more complicated R-Tree (O(log(n)) + Point-in-Poly (O(m)) system for geofences (that also can't backfill prior results when new geofences are added)

3. With a grid, data science can be assured of approximately equal area and time across these space-time buckets so normalizing the data for analysis between them is not necessary, regardless of where on the planet it came from (cross-city analysis and forecasting). With a hexagon grid, data science can also be assured that all neighboring cells are the same distance from each other and that all neighboring cells share a measurable edge rather than an infinitesimal point (like squares) so flow analysis between the cells is similarly simplified and needs no normalizing.

4. With a hierarchical hexagon grid we can quantize the data at the finest granularity (which is higher resolution than commercial GPS, about the size of a coffee table in diameter) and it can be rapidly reaggregated upwards to other resolutions (with some small error introduced since hexagons do not properly tessellate) for data science to determine what the "right" resolution is for the analysis at hand, then the realtime aggregating system can be updated to index at that resolution natively, as well, to improve bucketing accuracy (H3 resolution 9 was one such blessed coarser resolution).

When we determined exactly what we needed, we didn't invent it to feel like we did something really cool, we reached out to Dr. Kevin Sahr in academia to help us make it, who used part of his DGGRID code to do so[1], and then spent nearly 2 years to make sure everything was legal for open sourcing.

What we did at Uber was focus on getting his core more easily consumable: Request that the core does not allocate memory on its own, but is passed in memory (so integration with memory-managed languages would be much simpler), implement many of the algorithms described by Red Blob Games to make manipulation of the data in the grid system more amenable, update the build and test system to a more modern standard (CMake, code coverage, and unit tests), and write C bindings in various languages.

[1](https://uber.github.io/h3/#/documentation/overview/use-cases) (references the paper that covers the work he did)

Re: Hexagonal Grids (2013)

#35
post #8

A surprise to see my page on HN! For those of you curious about the tech: Diagrams are in SVG. Canvas would be faster but SVG is easier for me to work with, especially for attaching mouse events to each hexagon. It also automatically scales to high dpi displays. With SVG and HTML accessed the same way, I can use the same code for updating text/samples as I do for updating diagrams. This includes interpolating values…

Thank you so much for your wonderful documentation. The H3 team at Uber used it so much for so many things. :)

Re: Hexagonal Grids (2013)

#36
This is one of the great things about the internet. Not only is it an amazing article about hexagonal grids that you would never find in a magazine much less a book, but the references are equally amazing and exhaustive.

I do remember back in the late 70's and seeing D&D using hexagonal grids for outdoors, and the despair and pain of trying to find a damn pad of hexagonal paper (I think I had to mail order from The Armory or Chessex?!?). It was pretty funny that years later, one of the first PostScript programs I wrote generated hexagon sheets that could be printed on the college laser printers.

Re: Hexagonal Grids (2013)

#37
I used this guide to help me prototype this engine, which is a hexagonal tile map with the ability to scroll infinitely! (Though, the backend isn’t all there). You can click tiles the change colors and the color persists and has real-time updates between browsers.

https://territories-1d6eb.firebaseapp.com

Re: Hexagonal Grids (2013)

#38
post #8

A surprise to see my page on HN! For those of you curious about the tech: Diagrams are in SVG. Canvas would be faster but SVG is easier for me to work with, especially for attaching mouse events to each hexagon. It also automatically scales to high dpi displays. With SVG and HTML accessed the same way, I can use the same code for updating text/samples as I do for updating diagrams. This includes interpolating values…

Hey,

I'm an astrophysicist in high energy gamma ray astronomy.

Or telescope sensors have hexagonal pixels.

You website is awesome and helped a lot writing the coordinate trafos and other stuff. We always recommended it to everyone involved.

One switch I always wished it had was to switch to a cartesian coordinate system where x points right, y points up and negative coordinates are allowed.

Re: Hexagonal Grids (2013)

#39
post #38
post #8

A surprise to see my page on HN! For those of you curious about the tech: Diagrams are in SVG. Canvas would be faster but SVG is easier for me to work with, especially for attaching mouse events to each hexagon. It also automatically scales to high dpi displays. With SVG and HTML accessed the same way, I can use the same code for updating text/samples as I do for updating diagrams. This includes interpolating values…

Hey, I'm an astrophysicist in high energy gamma ray astronomy. Or telescope sensors have hexagonal pixels. You website is awesome and helped a lot writing the coordinate trafos and other stuff. We always recommended it to everyone involved. One switch I always wished it had was to switch to a cartesian coordinate system where x points right, y points up and negative coordinates are allowed.

What drove the decision to go with hexagonal pixels? Sounds pretty crazy and cool.

Re: Hexagonal Grids (2013)

#40

Earlier quoted context omitted.

this uber-h3 has been public for a while, and it brings mixed reaction for me -- it seems like Uber wanted to 'invent' something really cool, as in, the showing off part is every bit as important, or more, than the tech. The reason to point that out is, spatial indexing is one of seriously studied topics in academic geometry. Yes, the classical papers can be a bit much, but there is a reason why they are so -- it rea…

I just want to make it clear that there's a real reason behind H3, not just "invent something really cool." I don't work at Uber, anymore, but I did work on the team that originated H3 and worked on H3. To condense it down to a few bullet points, we realized: 1. We needed to move from geofences to a grid for both data science reasons and scaling reasons to perform realtime aggregated and anonymized activity analysis…

excellent -- reading carefully; this one is fun .. https://github.com/uber/h3-py/blob/master/docs/UnifiedDataLa...
Post reply on HN