Converts a track-like object to the minimal track representation used by
gmov. The returned object is a tibble with numeric x_ and y_ columns.
Many amt tracks use these coordinate names and should work when they are
data-frame-like. This helper intentionally works with simple object shapes
and does not depend on amt internals.
Coordinates are assumed to be in a common planar coordinate system. gmov does
not transform track coordinates.
Arguments
- x
A track-like object. Supported inputs include data frames with
x_andy_columns, data frames withxandycolumns,amt-style step objects withx1_,y1_,x2_, andy2_, andsfpoint objects. Step objects are converted to the corresponding sequence of segment endpoints.- x_col, y_col
Optional character names of the coordinate columns.
- ...
Currently unused.
Examples
trk <- data.frame(x = c(0, 1, 2), y = c(0, 1, 1))
as_gmov_track(trk)
#> # A tibble: 3 × 4
#> x y x_ y_
#> <dbl> <dbl> <dbl> <dbl>
#> 1 0 0 0 0
#> 2 1 1 1 1
#> 3 2 1 2 1