st_dump
Preview
This feature is in Public Preview.
Returns an array containing the single geometries in the input geometry.
For the corresponding Databricks SQL function, see st_dump function.
Syntax
Python
from pyspark.databricks.sql import functions as dbf
dbf.st_dump(col=<col>)
Parameters
Parameter | Type | Description |
|---|---|---|
|
| A Geometry value. |
Examples
Python
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()
Output
[Row(result='SRID=3857;LINESTRING(1 2,3 4)'), Row(result='SRID=3857;LINESTRING(7 8,6 5)')]
Python
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()
Output
[Row(result='POINT EMPTY'), Row(result='POINT EMPTY'), Row(result='POINT(3 4)'), Row(result='POINT(5 6)')]