从地理哈希生成点

重要

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

返回与输入 geohash 值对应的 geohash 网格框中心,形式为 2D 点几何。

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

Syntax

from pyspark.databricks.sql import functions as dbf

dbf.st_pointfromgeohash(col=<col>)

参数

参数 类型 Description
col pyspark.sql.Columnstr 表示 geohash 值的字符串值。

例子

from pyspark.databricks.sql import functions as dbf
df = spark.createDataFrame([('9q8yyh',)], ['geohash'])
df.select(dbf.st_astext(dbf.st_pointfromgeohash('geohash')).alias('result')).collect()
[Row(result='POINT(-122.4261474609375 37.77374267578125)')]