geo.ST_LineString() function
The geo.ST_LineString()
function is experimental and subject to change at any time.
By using this function, you accept the risks of experimental functions.
The geo.ST_LineString()
function converts a series of geographic points into
linestring.
Group data into meaningful, ordered paths to before converting to linestring.
Rows in each table must have lat
and lon
columns.
Output tables contain a single row with a st_linestring
column containing the resulting linestring.
geo.ST_LineString()
is an aggregate function.
import "experimental/geo"
geo.ST_LineString()
Examples
Convert a series of geographic points into linestring
Input data
_time | id | lon | lat |
---|---|---|---|
2020-01-01T00:00:00Z | a213b | 39.7515 | 14.01433 |
2020-01-02T00:00:00Z | a213b | 38.3527 | 13.9228 |
2020-01-03T00:00:00Z | a213b | 36.9978 | 15.08433 |
import "experimental/geo"
data
|> geo.ST_LineString()
Output data
id | st_linestring |
---|---|
a213b | 39.7515 14.01433, 38.3527 13.9228, 36.9978 15.08433 |
Was this page helpful?
Thank you for your feedback!
Support and feedback
Thank you for being part of our community! We welcome and encourage your feedback and bug reports for Flux and this documentation. To find support, use the following resources:
InfluxDB Cloud customers can contact InfluxData Support.