Is corse parent == parent index?

190 Views Asked by At

In the H3 library, you can find the corse parent index of a H3 hexagon using the h3ToParent method. Is the corse parent the same as the parent? If not how do I find the true parent index?

1

There are 1 best solutions below

0
On BEST ANSWER

The H3 docs generally use "coarse" to indicate larger-hex resolutions with lower numbers (e.g. res 1 hexes, 607,220km2), and "fine" to indicate smaller-hex resolutions with higher numbers (e.g. res 10 hexes, 0.015km2). This is to avoid confusion with "bigger"/"smaller" terminology (is a bigger resolution a large hex or a larger res number?).

The h3ToParent method can return the direct parent of a hexagon (i.e. the coarser hexagon that contains it at the next resolution up), or its ancestor at any given coarser resolution - the second argument specifies the resolution of the parent you want to obtain.

enter image description here

In this image, for example, all of the larger hexagons are "parents" of the smallest hexagon in the center. If the resolution of the center hex is 7, then:

H3Index directParent = h3ToParent(centerHex, 6);
H3Index grandParent = h3ToParent(centerHex, 5);
// etc