這很重要
這項功能目前處於 公開預覽版。
傳回對應輸入地理 hash 值的地理 hash 格子,作為 2D 多邊形幾何體。
關於對應的 Databricks SQL 函式,請參見 st_geomfromgeohash 函數。
語法
from pyspark.databricks.sql import functions as dbf
dbf.st_geomfromgeohash(col=<col>)
參數
| 參數 | 類型 | Description |
|---|---|---|
col |
pyspark.sql.Column 或 str |
一個字串代表一個GeoHash值。 |
範例
from pyspark.databricks.sql import functions as dbf
df = spark.createDataFrame([('9q8yyh',)], ['geohash'])
df.select(dbf.st_astext(dbf.st_geomfromgeohash('geohash')).alias('result')).collect()
[Row(result='POLYGON((-122.431640625 37.77099609375,-122.431640625 37.7764892578125,-122.420654296875 37.7764892578125,-122.420654296875 37.77099609375,-122.431640625 37.77099609375))')]