st_boundary
Preview
This feature is in Public Preview. You can confirm preview enrollment on the Previews page. See Manage Databricks previews.
Returns the boundary of the input geometry as a geometry.
For the corresponding Databricks SQL function, see st_boundary function.
Syntax
Python
from pyspark.databricks.sql import functions as dbf
dbf.st_boundary(col=<col>)
Parameters
Parameter | Type | Description |
|---|---|---|
|
| A Geometry value. |
Examples
Python
from pyspark.databricks.sql import functions as dbf
df = spark.createDataFrame([('POLYGON((0 0,10 0,10 10,0 10,0 0),(2 2,8 2,8 8,2 8,2 2))',)], ['wkt'])
df.select(dbf.st_asewkt(dbf.st_boundary(dbf.st_geomfromtext('wkt', 3857))).alias('result')).collect()
Output
[Row(result='SRID=3857;MULTILINESTRING((0 0,10 0,10 10,0 10,0 0),(2 2,8 2,8 8,2 8,2 2))')]