Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Important
This feature is in Public Preview.
Returns a linestring geometry whose points are the non-empty points of the geometries in the input array of geometries, which are expected to be points, linestrings, or multipoints.
For the corresponding Databricks SQL function, see st_makeline function.
Syntax
from pyspark.databricks.sql import functions as dbf
dbf.st_makeline(col=<col>)
Parameters
| Parameter | Type | Description |
|---|---|---|
col |
pyspark.sql.Column or str |
An array of Geometry values. |
Examples
from pyspark.databricks.sql import functions as dbf
from pyspark.sql.functions import array, expr
df = spark.createDataFrame([(['POINT(1 2)','POINT(3 4)'],)], ['wkt_array'])
df.select(dbf.st_astext(dbf.st_makeline(expr("transform(wkt_array, wkt -> st_geomfromtext(wkt))"))).alias('result')).collect()
[Row(result='LINESTRING(1 2,3 4)')]