Skip to main content

st_geogfromwkb

Preview

This feature is in Public Preview. You can confirm preview enrollment on the Previews page. See Manage Databricks previews.

Parses the input WKB description and returns the corresponding Geography value.

For the corresponding Databricks SQL function, see st_geogfromwkb function.

Syntax

Python
from pyspark.databricks.sql import functions as dbf

dbf.st_geogfromwkb(col=<col>)

Parameters

Parameter

Type

Description

col

pyspark.sql.Column or str

A BINARY value in WKB format, representing a Geography value.

Examples

Python
from pyspark.databricks.sql import functions as dbf
df = spark.createDataFrame([(bytes.fromhex('0103000000010000000400000000000000000000000000000000000000000000000000144000000000000018400000000000001c4000000000000020c000000000000000000000000000000000'),)], ['wkb'])
df.select(dbf.st_astext(dbf.st_geogfromwkb('wkb')).alias('result')).collect()
Output
[Row(result='POLYGON((0 0,5 6,7 -8,0 0))')]