0

Is it possible to convert

from: "H3Index Representation" https://h3geo.org/docs/core-library/h3Indexing

to: "IJK Coordinates" https://h3geo.org/docs/core-library/coordsystems

?

Assuming there is an API for it: Which API would have to be used ? And is this API available in the DLL/runtime library ?

If there is no API for it, is there another way ?

(Maybe vertex API can be used for this ?)

The current version 3.x DLL seems to be missing some APIs also marked as "internal functions" in the include headers.

oOo
  • 261
  • 2
  • 16

2 Answers2

1

We don't offer an external API for IJK coords - these coordinates would be difficult to work with, as they are only valid within a single icosahedron face, and crossing an icosahedron edge would result in a different coordinate system.

We do offer a relative IJ coordinate system through the API:

These functions require an "origin" index that serves to anchor the coordinate system on a single icosahedron face, and they are capable of "unfolding" the icosahedron to cross over to one adjacent face, so they're generally going to be more reliable than direct access to the IJK coords. You can convert IJ to IJK coords fairly easily. Just note that different parts of the world will have different coordinate systems, hence the "origin" requirement - this is meant for local area use, not global use.

nrabinowitz
  • 55,314
  • 10
  • 149
  • 165
0

The main issue I was facing is missing API functions in the H3.DLL. To build the H3.DLL with all API implementations the following commands should be used:

Step 2: Configure for DLL release: cmake ..\h3V4 -DBUILD_TESTING=OFF -DBUILD_SHARED_LIBS=ON -DCMAKE_WINDOWS_EXPORT_ALL_SYMBOLS=ON

Step 3: cmake --build . --config Release

Once this is done the following API will become available:

_h3ToFaceIjk

Which can be used to convert an H3Index to a FaceIJK Index.

Where there will be 4 coordinates returned into a structure via a pointer.

The first coordinate is some kind of face number. Possible related to this icohedron. The second,third,fourth are the IJK, they go up to a certain range.

The total coordinate system is indeed a bit messy when using this API.

It would indeed be usefull, I think, to base the IJK coordinates on some selected hexagon, so that this hexagon can functions as location 0,0,0,0 or just 0,0,0.

And then re-map all other hexagons around it. It might be even more usefull, if the coordinates can be negative and positive as well.

I will try and play with other conversion routines in the library, which might do this. I am not sure if it will be perfect.

So far the documentation seems to indicate that coordinates in FaceIJK system are also positive...

I could also try and come up with my own algorithm to try and attach desireable coordinates to the hexagons.

Basically

-1 -1 -1 +1 +1 +1

Would be desirable.

Pretend the above drawing is a hexagon or triangulization inside the hexagon... and those numbers are on the points/verteces of the hexagon.

oOo
  • 261
  • 2
  • 16