ST_LineFromText takes a string column and returns a linestring column.
The string column must contain the well-known text (WKT)
representation of linestring geometries.
You can optionally specify a spatial reference for the result linestring column.
The sr
parameter value must be a valid SRID or WKT string.
Function | Syntax |
---|---|
Python | line |
SQL | ST |
Scala | line |
For more details, go to the GeoAnalytics for Microsoft Fabric API reference for line_from_text.
Examples
from geoanalytics_fabric.sql import functions as ST, Polygon, Point
data = [("LINESTRING (-3636954.77 7750916.26, -3168756.90 7966747.98, -3124795.45 7893415.62)", )]
df = spark.createDataFrame(data, ["wkt"])
df.select(ST.line_from_text("wkt", sr=8857).alias("line_from_text")).show(truncate=False)
Result
+---------------------------------------------------------------------------------------+
|line_from_text |
+---------------------------------------------------------------------------------------+
|{"paths":[[[-3636954.77,7750916.26],[-3168756.9,7966747.98],[-3124795.45,7893415.62]]]}|
+---------------------------------------------------------------------------------------+
Version table
Release | Notes |
---|---|
1.0.0-beta | Python, SQL, and Scala functions introduced |