跳转至

H3 cell to parent(H3 单元转父级(H3 cell to parent))

Supported in: Batch, Faster, 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\

  • Parent resolution: H3 grid parent resolution between 0 and 15 (inclusive).
    Expression\

Output type: H3 Index

Examples

Example 1: Base case

Argument values:

  • H3 index: h3Index
  • Parent resolution: parentResolution
h3Index parentResolution Output
881f1d4887fffff 7 871f1d488ffffff
860800017ffffff 3 830800fffffffff

Example 2: Null case

Argument values:

  • H3 index: h3Index
  • Parent resolution: parentResolution
h3Index parentResolution Output
87283472bgggggg 9 null
860800017ffffff -1 null
860800017ffffff 16 null
null 6 null
860800017ffffff null null

Example 3: Edge case

Argument values:

  • H3 index: h3Index
  • Parent resolution: 15
h3Index Output
8f2000000000000 8f2000000000000

Example 4: Edge case

Argument values:

  • H3 index: h3Index
  • Parent resolution: 0
h3Index Output
860800017ffffff 8009fffffffffff


中文翻译


H3 单元转父级(H3 cell to parent)

支持:批处理(Batch)、快速处理(Faster)、流处理(Streaming)

获取指定父级粗粒度分辨率下 H3 索引的父级。若分辨率 <0 或 >15,或分辨率高于给定索引,则返回 null。

表达式类别: 地理空间(Geospatial)

声明的参数

  • H3 索引(H3 index): 有效的 H3 索引。
    表达式\<H3 Index>
  • 父级分辨率(Parent resolution): 介于 0 到 15(含)之间的 H3 网格父级分辨率。
    表达式\<Byte | Integer | Long | Short>

输出类型: H3 Index

示例

示例 1:基本情况

参数值:

  • H3 索引: h3Index
  • 父级分辨率: parentResolution
h3Index parentResolution 输出
881f1d4887fffff 7 871f1d488ffffff
860800017ffffff 3 830800fffffffff

示例 2:空值情况

参数值:

  • H3 索引: h3Index
  • 父级分辨率: parentResolution
h3Index parentResolution 输出
87283472bgggggg 9 null
860800017ffffff -1 null
860800017ffffff 16 null
null 6 null
860800017ffffff null null

示例 3:边界情况

参数值:

  • H3 索引: h3Index
  • 父级分辨率: 15
h3Index 输出
8f2000000000000 8f2000000000000

示例 4:边界情况

参数值:

  • H3 索引: h3Index
  • 父级分辨率: 0
h3Index 输出
860800017ffffff 8009fffffffffff