ST_MultiLinestring takes an array column and returns a linestring column. The input array column must contain an array of arrays point geometries.
Function | Syntax |
---|---|
Python | multilinestring(*point |
SQL | ST |
Scala | multilinestring(point |
For more details, go to the GeoAnalytics Engine API reference for multilinestring.
This function implements the OpenGIS Simple Features Implementation Specification for SQL 1.2.1.
Examples
from geoanalytics.sql import functions as ST, Point
df = spark.createDataFrame([([[Point(2, 2), Point(1, 1)]], ), ([[Point(0, 0), Point(10, 0), Point(20, 0)], [Point(5, 2), Point(6, 10)]], )], ["point_arrays"])
df.select(ST.multilinestring("point_arrays").alias("multilinestring")).show(truncate=False)
Result
+------------------------------------------------+
|multilinestring |
+------------------------------------------------+
|{"paths":[[[2,2],[1,1]]]} |
|{"paths":[[[0,0],[10,0],[20,0]],[[5,2],[6,10]]]}|
+------------------------------------------------+
Version table
Release | Notes |
---|---|
1.0.0 | Python and SQL functions introduced |
1.5.0 | Scala function introduced |