メインコンテンツまでスキップ

h3_kring

元のセル ID から (グリッド) 距離 k 以内にあるH3 セル IDを返します。Spark Connect をサポートします。

対応する Databricks SQL 関数については、 h3_kring関数を参照してください。

構文

Python
from pyspark.databricks.sql import functions as dbf

dbf.h3_kring(col1=<col1>, col2=<col2>)

パラメーター

パラメーター

Type

説明

col1

pyspark.sql.Column または str

または文字列として表される H3 セル ID。

col2

pyspark.sql.Column、文字列、または整数

H3 セル ID (最初の引数) からの最大グリッド距離。

Python
from pyspark.databricks.sql import functions as dbf
df = spark.createDataFrame([(599686042433355775, 1,)], ['h3l', 'k'])
df.select(dbf.h3_kring('h3l', 'k').alias('result')).collect()
Output
[Row(result=[599686042433355775, 599686030622195711, 599686044580839423, 599686038138388479,     599686043507097599, 599686015589810175, 599686014516068351])]
Python
df.select(dbf.h3_kring('h3l', 1).alias('result')).collect()
Output
[Row(result=[599686042433355775, 599686030622195711, 599686044580839423, 599686038138388479,     599686043507097599, 599686015589810175, 599686014516068351])]