H3 cell to parent

Supported in: Batch, Streaming

Get parent of an H3 index at given resolution specifying parent coarseness. Returns null for resolution <0 or >15 or resolution higher than given index.

Expression categories: Geospatial

Declared arguments

  • H3 index - A valid H3 index.
    Expression<H3 Index>
  • Parent resolution - H3 grid parent resolution between 0 and 15 (inclusive).
    Expression<Byte | Integer | Long | Short>

Output type: H3 Index

Examples

Example 1: Base case

Argument values:

  • H3 index: h3Index
  • Parent resolution: parentResolution
h3IndexparentResolutionOutput
881f1d4887fffff7871f1d488ffffff
860800017ffffff3830800fffffffff

Example 2: Null case

Argument values:

  • H3 index: h3Index
  • Parent resolution: parentResolution
h3IndexparentResolutionOutput
87283472bgggggg9null
860800017ffffff-1null
860800017ffffff16null
null6null
860800017ffffffnullnull

Example 3: Edge case

Argument values:

  • H3 index: h3Index
  • Parent resolution: 15
h3IndexOutput
8f20000000000008f2000000000000

Example 4: Edge case

Argument values:

  • H3 index: h3Index
  • Parent resolution: 0
h3IndexOutput
860800017ffffff8009fffffffffff