這很重要
這項功能目前處於 公開預覽版。
解析輸入的 EWKB 描述並回傳對應 的幾何 值。
關於對應的 Databricks SQL 函式,請參見 st_geomfromewkb 函數。
語法
from pyspark.databricks.sql import functions as dbf
dbf.st_geomfromewkb(col=<col>)
參數
| 參數 | 類型 | Description |
|---|---|---|
col |
pyspark.sql.Column 或 str |
一個以 EWKB 格式表示的二進位值,代表 一個幾何 值。 |
範例
from pyspark.databricks.sql import functions as dbf
df = spark.createDataFrame([(bytes.fromhex('0103000020E6100000010000000400000000000000000000000000000000000000000000000000144000000000000018400000000000001C4000000000000020C000000000000000000000000000000000'),)], ['ewkb'])
df.select(dbf.st_asewkt(dbf.st_geomfromewkb('ewkb')).alias('result')).collect()
[Row(result='SRID=4326;POLYGON((0 0,5 6,7 -8,0 0))')]