Skip to content

Order of returned children #589

Answered by nrabinowitz
Sdeimen asked this question in Q&A
Discussion options

You must be logged in to vote

There is a deterministic order to the returned cells in h3_to_children, and you can rely on it to be stable, but it's not the order you describe. The children are returned in "digit" order, which is to say child 0, child 1, child 2, and so on - these are the digits set in the hierarchical index (see the indexing docs for more info). Child 0 is the center child, but beyond that you can't make assumptions about either the cardinal direction or even the grid direction of a numbered child.

  • Numbered children are not necessarily adjacent. As shown in the image below, the numbering is based on IJK axes, and doesn't go in clockwise or counterclockwise order.

  • The orientation of the axes depend…

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@nrabinowitz
Comment options

@Sdeimen
Comment options

Answer selected by Sdeimen
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants