convert to and from amt class 'track_xy'
# S3 method for track_xy as_sftrack(data, crs = attr(data, "crs_"), ...) # S3 method for track_xy as_sftraj(data, ...) sftrack_to_track_xy(data, ...)
data | the sftrack object |
---|---|
crs | a crs string from rgdal of the crs and projection information for the spatial data. Defaults to the one provided by |
... | any arguments to be passed on to `amt::make_track()`. See the help file in `amt` for more details |
#> #>#>#> #>#>#> #>#>#> #>data(sh) ## Add timestamp column, remove duplicated timestamps, and add ID #column: sh$timestamp <- as.POSIXct(paste(sh$day,sh$time)) sh <- sh[!duplicated(sh$timestamp), ] sh$id <- "Animal 1" ## Create the 'track_xyt' object: tr1 <- make_track(sh, x_epsg31467, y_epsg31467, timestamp, id = id )#>#> Warning: GDAL Message 1: +init=epsg:XXXX syntax is deprecated. It might return a CRS with a non-EPSG compliant axis order.#> sftrack (*locations*) with 6 features and 3 fields #> geometry: "geometry" (XY, CRS: DHDN / 3-degree Gauss-Kruger zone 3) #> timestamps: "sft_timestamp" (integer) #> groupings: "sft_group" (*id*) #> ------------------------------- #> sft_timestamp sft_group geometry #> 1 2008-03-30 00:01:47 (id: Animal 1) POINT (3558528 5999094) #> 2 2008-03-30 06:00:54 (id: Animal 1) POINT (3558513 5999055) #> 3 2008-03-30 12:01:47 (id: Animal 1) POINT (3558564 5999146) #> 4 2008-03-30 18:01:24 (id: Animal 1) POINT (3558504 5999072) #> 5 2008-03-30 18:25:56 (id: Animal 1) POINT (3558495 5999051) #> 6 2008-03-30 18:26:05 (id: Animal 1) POINT (3558493 5999052)