distância_de_tentativa_h3
Retorna a distância da grade entre dois IDs de células H3 da mesma resolução, ou None se a distância não estiver definida.
Para a função Databricks SQL correspondente, consulte a funçãoh3_try_distance.
Sintaxe
Python
from pyspark.databricks.sql import functions as dbf
dbf.h3_try_distance(col1=<col1>, col2=<col2>)
Parâmetros
Parâmetro | Tipo | Descrição |
|---|---|---|
|
| Um ID de célula H3, representado como uma coluna ou strings. |
|
| Um ID de célula H3, representado como uma coluna ou strings. |
Exemplos
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)]