st_makepolygon
Construit un polygone à partir de la limite extérieure d'entrée et d'un tableau facultatif de limites intérieures, représentées par des lignes brisées fermées.
Pour la fonction Databricks SQL correspondante, consultez la fonctionst_makepolygon.
Syntaxe
Python
from pyspark.databricks.sql import functions as dbf
dbf.st_makepolygon(col1=<col1>, col2=<col2>)
parameter
Exemples
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))')]