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

h3_try_distance

同じ解像度の 2 つのH3 セル ID間のグリッド距離を返します。距離が未定義の場合はNone返します。

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

構文

Python
from pyspark.databricks.sql import functions as dbf

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

パラメーター

パラメーター

Type

説明

col1

pyspark.sql.Column または str

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

col2

pyspark.sql.Column または str

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

Python
from pyspark.databricks.sql import functions as dbf
df1 = spark.createDataFrame([(599686030622195711, 599686015589810175,)], ['h3l1', 'h3l2'])
df1.select(dbf.h3_try_distance('h3l1', 'h3l2').alias('result')).collect()
Output
[Row(result=2)]
Python
df2 = spark.createDataFrame([(644730217149254377, 644877068142171537,)], ['h3l1', 'h3l2'])
df2.select(dbf.h3_try_distance('h3l1', 'h3l2').alias('result')).collect()
Output
[Row(result=None)]