geo.asTracks() function
The geo.asTracks()
function is experimental and subject to change at any time.
By using this function, you accept the risks of experimental functions.
The geo.asTracks()
function groups rows into tracks (sequential, related data points).
import "experimental/geo"
geo.asTracks(
groupBy: ["id","tid"],
orderBy: ["_time"],
)
Parameters
groupBy
Columns to group by.
These columns should uniquely identify each track.
Default is ["id","tid"]
.
orderBy
Column to order results by.
Default is ["_time"]
.
tables
Input data.
Default is piped-forward data (<-
).
Examples
Group tracks in a box-shaped region
region = {minLat: 40.51757813, maxLat: 40.86914063, minLon: -73.65234375, maxLon: -72.94921875}
from(bucket: "example-bucket")
|> range(start: -1h)
|> filter(fn: (r) => r._measurement == "example-measurement")
|> geo.gridFilter(region: region)
|> geo.toRows(correlationKey: ["_time", "id"])
|> geo.asTracks()
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.