st_makepolygon
Constructs a polygon from the input outer boundary and optional array of inner boundaries, represented as closed linestrings.
For the corresponding Databricks SQL function, see st_makepolygon function.
Syntax
Python
from pyspark.databricks.sql import functions as dbf
dbf.st_makepolygon(col1=<col1>, col2=<col2>)
Parameters
Examples
Python
from pyspark.databricks.sql import functions as dbf
df = spark.createDataFrame([('LINESTRING(0 0,10 0,10 10,0 10,0 0)',)], ['wkt'])
df.select(dbf.st_astext(dbf.st_makepolygon(dbf.st_geomfromtext('wkt'))).alias('result')).collect()
Output
[Row(result='POLYGON((0 0,10 0,10 10,0 10,0 0))')]