Share via


h3_centeraswkb

Returns the center of an H3 cell in WKB format. Supports Spark Connect.

For the corresponding Databricks SQL function, see h3_centeraswkb function.

Syntax

from pyspark.databricks.sql import functions as dbf

dbf.h3_centeraswkb(col=<col>)

Parameters

Parameter Type Description
col pyspark.sql.Column or str An H3 cell ID, represented as a Column or string.

Examples

from pyspark.databricks.sql import functions as dbf
from pyspark.sql import functions as f
df = spark.createDataFrame([(599686042433355775,),], ['h3l'])
df.select(f.hex(dbf.h3_centeraswkb('h3l')).alias('result')).collect()
[Row(result='0101000000A728A6F17C7E5EC0346612F542AC4240')]