uber / h3-js

h3-js provides a JavaScript version of H3, a hexagon-based geospatial indexing system.
https://uber.github.io/h3
Apache License 2.0
875 stars 79 forks source link

How to apply h3 to different planets / spheroids? #129

Closed lancejpollard closed 2 years ago

lancejpollard commented 2 years ago

I have this current question on StackOverflow, not sure if anyone will answer this GIS-related question there, so linking here:

Where is the origin that maps the base hexagons in Uber's H3 Hexagonal hierarchical geospatial indexing system to the globe?

Basically, the first question is, where is the data/internal-code that actually maps the hexagons to the Earth's surface to specific lat/lng coordinates for each tile?

That leads me to the main question, which is, how would you go about applying this same system to a different planet or spheroid like the moon or Jupiter, or the sun? I would need to somehow project the 122 tiles onto the spheroid... Oh wow I am already lost, I am pretty sure that is what the core of what H3 does internally. But the question is how do you plugin a different sized planet or something, and how do I say "this tile is right here on the moon", etc.? I would like to traverse the hex tiles at a specific resolution on the moon, knowing that the projection is firmly planted permanently on the surface of the moon basically, not sure how that would work.

nrabinowitz commented 2 years ago

See this related answer. The main issues are:

The easiest, and likely best, option if you need to change these is to transform the results, rather than trying to change anything in the H3 internals.

lancejpollard commented 2 years ago

Interesting, okay well would you be able to explain what you mean by transform the results? What is an example?

And in terms of orientation, what if I do care, what do I do then? Or what if I don't, what to do then.

nrabinowitz commented 2 years ago

Interesting, okay well would you be able to explain what you mean by transform the results? What is an example?