Skip to main content

st_geogfromewkt

Preview

This feature is in Public Preview.

Parses an Extended Well-Known Text (EWKT) description of a geography and returns the corresponding Geography value. Only SRID 4326 is supported.

For the corresponding Databricks SQL function, see st_geogfromewkt function.

Syntax

Python
from pyspark.databricks.sql import functions as dbf

dbf.st_geogfromewkt(col=<col>)

Parameters

Parameter

Type

Description

col

pyspark.sql.Column or str

A string value, representing a geography in Extended WKT (EWKT) format.

Notes

The SRID of the returned Geography value is 4326.

The function returns None if the input is None.

Examples

Python
from pyspark.databricks.sql import functions as dbf
df = spark.createDataFrame([('SRID=4326;POINT Z (1 2 3)',)], ['ewkt'])
df.select(dbf.st_asewkt(dbf.st_geogfromewkt('ewkt')).alias('result')).collect()
Output
[Row(result='SRID=4326;POINT Z (1 2 3)')]