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

h3_hexring

原点 H3 セルを中心とし、原点 H3 セルからグリッド距離 k にある中空の六角形リングを形成するH3 セル IDの配列を返します。Spark Connect をサポートします。

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

構文

Python
from pyspark.databricks.sql import functions as dbf

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

パラメーター

パラメーター

Type

説明

col1

pyspark.sql.Column または str

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

col2

pyspark.sql.Columnstr 、または int

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

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