st_geogfromtext

重要

此功能目前以公共预览版提供。

分析 WKT 说明并返回相应的 Geography 值。

有关相应的 Databricks SQL 函数,请参阅 st_geogfromtext 函数

Syntax

from pyspark.databricks.sql import functions as dbf

dbf.st_geogfromtext(col=<col>)

参数

参数 类型 Description
col pyspark.sql.Columnstr 一个采用 WKT 格式的字符串值,表示 Geography 值。

例子

from pyspark.databricks.sql import functions as dbf
df = spark.createDataFrame([('POLYGON((0 0,5 6,7 -8,0 0))',)], ['wkt'])
df.select(dbf.st_astext(dbf.st_geogfromtext('wkt')).alias('result')).collect()
[Row(result='POLYGON((0 0,5 6,7 -8,0 0))')]