Share via


st_dump

Important

This feature is in Public Preview. You can confirm preview enrollment on the Previews page. See Manage Azure Databricks previews.

Returns an array containing the single geometries in the input geometry.

For the corresponding Databricks SQL function, see st_dump function.

Syntax

from pyspark.databricks.sql import functions as dbf

dbf.st_dump(col=<col>)

Parameters

Parameter Type Description
col pyspark.sql.Column or str A Geometry value.

Examples

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)')]