ST_CreateDistance takes a number and a linear unit and returns a distance tuple. The linear unit can be meters
,
kilometers
, feet
, miles
, or nauticalmiles
. Both the value and unit can be specified as either literal
values or columns.
The distance tuple can be used to query and split tracks using track functions.
Tracks are linestrings that represent the change in an entity's location over time. Each vertex in the linestring has a timestamp (stored as the M-value) and the vertices are ordered sequentially.
For more information on using tracks in GeoAnalytics for Microsoft Fabric, see the core concept topic on tracks.
Function | Syntax |
---|---|
Python | create |
SQL | ST |
Scala | create |
For more details, go to the GeoAnalytics for Microsoft Fabric API reference for create_distance.
Examples
from geoanalytics_fabric.sql import functions as ST
data = [(4.3, "meters"),(5.6, "meters"),(2.7, "feet")]
spark.createDataFrame(data, ["value", "units"]) \
.select(ST.create_distance("value", "units").alias("create_distance")) \
.show(truncate=False)
+---------------+
|create_distance|
+---------------+
|{4.3, meter} |
|{5.6, meter} |
|{2.7, foot} |
+---------------+
Version table
Release | Notes |
---|---|
1.0.0-beta | Python, SQL, and Scala functions introduced |