Add a trajectory field to the trajectory_fields table.

palms_add_trajectory_field(name, formula, after_conversion = FALSE)

Arguments

name

The name of the field as a string.

formula

The formula as a string. Note that these formulas act on all palmsplus points that are part of the same trip (tripnumber).

after_conversion

Logical. If TRUE, this field will be calculated after the trajectory LINESTRING has been created. For example, a formula that contains st_length() can only be evaluated with geometry.

Value

If the trajectory_fields table is not present in the global environment, it will be created. If it already exists, the new field will be appended.

Examples

palms_add_trajectory_field("mot", "first(tripmot)")