pyspark.sql.functions.st_geogfromwkb#

pyspark.sql.functions.st_geogfromwkb(wkb)[source]#

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

New in version 4.1.0.

Parameters
wkbColumn or str

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

Examples

>>> from pyspark.sql import functions as sf
>>> df = spark.createDataFrame([(bytes.fromhex('0101000000000000000000F03F0000000000000040'),)], ['wkb'])  # noqa
>>> df.select(sf.hex(sf.st_asbinary(sf.st_geogfromwkb('wkb'))).alias('result')).collect()
[Row(result='0101000000000000000000F03F0000000000000040')]