Skip to main content
The following functions are available in both SQL and the native API.

ST_TRACKDURATION([unit,] t)

Returns the total time, in the given unit, spanned by timestamp values in column t. Grouping by track ID will return the duration per track.The duration can be returned in any of the following date/time units:
  • YEAR
  • MONTH
  • DAY
  • HOUR
  • MINUTE
  • SECOND
  • MILLISECOND
The default unit is MILLISECOND.

ST_TRACKLENGTH(lat, lon, t[, solution])

Returns the total length of the track whose position values are specified by lat & lon and whose ordering is determined by an ascending sort on the timestamp t. Length can be returned with any of the following solution types:
TypeDescription
02D Euclidean length in degrees
1(default) Length on a sphere in meters
2Length on a spheroid in meters

ST_TRACK_DWITHIN

The ST_TRACK_DWITHIN table function finds tracks that are related, within spatial or temporal bounds (or both) to the given track(s). The track(s) to use as the filter criteria will be specified by the SEARCH_* parameters. The TRACK_* parameters specify the set of tracks to search through for a match.
This function is only available in SQL or in the native API via /execute/sql.
The basic form of the ST_TRACK_DWITHIN function follows.
ST_TRACK_DWITHIN Table Function Syntax

TRACK_TABLE

Name of the table to search for tracks matching the track(s) specified in the SEARCH_* data set.To perform a search on the flights table, pass the name of the table to INPUT_TABLE:
To perform a search on the result of a query, pass the query to INPUT_TABLE:

TRACK_ID_COLUMN

Table to search track column, containing the unique identifier for the track to which each track point belongs.

TRACK_X_COLUMN

Table to search track column, containing the longitude value of each track point.

TRACK_Y_COLUMN

Table to search track column, containing the latitude value of each track point.

TRACK_ORDER_COLUMN

Table to search track column, by which the searched track points will be sorted in ascending order.

SEARCH_TABLE

Name of the search criteria track table, containing the track(s) to be used as the filter criteria when searching for matching tracks in the TRACK_* data set.To match tracks from the flights_of_interest table, pass the name of the table to INPUT_TABLE:
To match tracks from the result of a query, pass the query to INPUT_TABLE:

SEARCH_ID_COLUMN

Search criteria track column, containing the unique identifier for the track to which each track point belongs.

SEARCH_X_COLUMN

Search criteria track column, containing the longitude value of each track point.

SEARCH_Y_COLUMN

Search criteria track column, containing the latitude value of each track point.

SEARCH_ORDER_COLUMN

Search criteria track column, by which the filter track points will be sorted in ascending order.

SEARCH_XY_DISTANCE

The radius around the given tracks to search for matching tracks.
This parameter is not applicable when using a SPATIAL_SOLUTION_TYPE of 0.
UnitDescription
fFeet
kiKilometers
m(default) Meters
miMiles

SPATIAL_SOLUTION_TYPE

Spatial match solution type; any of the following:
TypeDescription
0(default) 2D Euclidean length in degrees
1Length on a sphere, returned in units specified by SEARCH_XY_DISTANCE
2Length on a spheroid, returned in units specified by SEARCH_XY_DISTANCE

SEARCH_TIME_DISTANCE

The maximum allowable time difference between a search criteria track’s point and a matched track’s points. The time can use any of the following suffices for units:
UnitDescription
msMilliseconds
s(default) Seconds
mMinutes
hHours
dDays
wWeeks
monthsMonths
yYears
To see the matches between a set of flights and a given set of flights of interest:
ST_TRACK_DWITHIN Example

ST_TRACKINTERSECTS

The ST_TRACKINTERSECTS table function finds tracks pass through the given geofence(s). The geofence(s) use as the filter will be specified by the GEOFENCE_* parameters. The TRACK_* parameters specify the set of tracks to search through for any intersecting the geofence(s). The result will include a record for each intersecting track & geofence pair, with:
  • a LINESTRING representing the full track intersecting a geofence
  • a LINESTRING representing the geofence it intersected
This function is only available in SQL or in the native API via /execute/sql.
The basic form of the ST_TRACKINTERSECTS function follows.
ST_TRACKINTERSECTS Table Function Syntax

TRACK_TABLE

Name of the table to search for tracks intersecting the geofence(s) specified in the SEARCH_* data set.To perform a search on the flights table, pass the name of the table to INPUT_TABLE:
To perform a search on the result of a query, pass the query to INPUT_TABLE:

TRACK_ID_COLUMN

Table to search track column, containing the unique identifier for the track to which each track point belongs.

TRACK_X_COLUMN

Table to search track column, containing the longitude value of each track point.

TRACK_Y_COLUMN

Table to search track column, containing the latitude value of each track point.

TRACK_ORDER_COLUMN

Table to search track column, by which the searched track points will be sorted in ascending order.

GEOFENCE_TABLE

Name of the geofence table, containing the WKT(s) to be used as the filter criteria when searching for intersecting tracks in the TRACK_* data set.To search for tracks intersecting the geofence(s) from the flight_area_of_interest table, pass the name of the geofence table to INPUT_TABLE:
To search for tracks intersecting the geofence(s) from the result of a query, pass the query to INPUT_TABLE:

GEOFENCE_ID_COLUMN

Geofence column, containing the unique identifier for the geofence.

GEOFENCE_WKT_COLUMN

Geofence column, containing the WKT bounds of the geofence.
To see the intersections between a set of flights and an area of interest:
ST_TRACKINTERSECTS Example