st_dump

重要

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

返回一个数组,其中包含输入几何图形中的单个几何图形。

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

Syntax

from pyspark.databricks.sql import functions as dbf

dbf.st_dump(col=<col>)

参数

参数 类型 Description
col pyspark.sql.Columnstr 几何图形值。

例子

from pyspark.databricks.sql import functions as dbf
df = spark.createDataFrame([('MULTILINESTRING((1 2,3 4),(7 8,6 5))',)], ['wkt'])
df.select(dbf.st_asewkt(dbf.explode(dbf.st_dump(dbf.st_geomfromtext('wkt', 3857)))).alias('result')).collect()
[Row(result='SRID=3857;LINESTRING(1 2,3 4)'), Row(result='SRID=3857;LINESTRING(7 8,6 5)')]
from pyspark.databricks.sql import functions as dbf
df = spark.createDataFrame([('GEOMETRYCOLLECTION(POINT EMPTY,MULTIPOINT(5 6,EMPTY,3 4))',)], ['wkt'])
df.select(dbf.st_astext(dbf.explode(dbf.st_dump(dbf.st_geomfromtext('wkt')))).alias('result')).collect()
[Row(result='POINT EMPTY'), Row(result='POINT EMPTY'), Row(result='POINT(3 4)'), Row(result='POINT(5 6)')]