Partager via


h3_kring

Retourne les ID de cellule H3 qui se trouvent à distance (grille) k de l’ID de cellule d’origine. Prend en charge Spark Connect.

Pour la fonction SQL Databricks correspondante, consultez h3_kring.

Syntaxe

from pyspark.databricks.sql import functions as dbf

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

Paramètres

Paramètre Type Descriptif
col1 pyspark.sql.Column ou str ID de cellule H3, représenté sous la forme d’une colonne ou d’une chaîne.
col2 pyspark.sql.Column, str ou int Distance maximale sur la grille depuis l'ID de cellule H3 (premier argument).

Examples

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()
[Row(result=[599686042433355775, 599686030622195711, 599686044580839423, 599686038138388479,     599686043507097599, 599686015589810175, 599686014516068351])]
df.select(dbf.h3_kring('h3l', 1).alias('result')).collect()
[Row(result=[599686042433355775, 599686030622195711, 599686044580839423, 599686038138388479,     599686043507097599, 599686015589810175, 599686014516068351])]