79645335

Date: 2025-05-30 10:57:53
Score: 0.5
Natty:
Report link

One way to fill in the row and column coordinates yourself would be to iterate through your hexagon features, counting until the latitude of the center point increases instead of decreasing. The hexagon prior would be the last in the first column. 0,5 in the example page below:

https://www.redblobgames.com/grids/hexagons/#coordinates

You now know your row count is 6.

Divide the total number of hexagons by 6 and that's your column count. 8 in our example. Now you can set row and column values for each hexagon.

From there you should be able to figure out an algorithm for which are the first, second, etc order rings from any hexagon in the grid. Will leave edge detection, etc to you as well.

It might also be work making a feature request for Turf to number the rows and columns during generation. You can do this via https://github.com/turfjs/turf/issues/

Reasons:
  • Long answer (-0.5):
  • No code block (0.5):
  • Low reputation (0.5):
Posted by: James Beard