Closed mdsumner closed 5 years ago
speedfilter needs a max.speed in metres per hour if it's projected, but in km per hour if it's in longlat.
The code behind
R summary(trip)
then reports mean/max speeds in metres per hour if it's projected, or km per hour if it's in longlat.
library(trip) library(adehabitatLT) data(porpoise) ptrip <- as.trip(porpoise) ptrip <- ptrip[, c("id", "date")] ## determined by trial and error proj4string(ptrip) <- CRS("+proj=utm +zone=21 +ellps=WGS84 +units=m +no_defs") library(rgdal) ltrip <- spTransform(ptrip, "+proj=longlat +ellps=WGS84") summary(ptrip) summary(ltrip) filter_ptrip <- ptrip[speedfilter(ptrip, max.speed= 50000), ] filter_ltrip <- ltrip[speedfilter(ltrip, max.speed = 5), ]
Reported by Anthony Fischbasch
I actually think this is ok, it's probably a bad choice long ago to use km/h for longlat, but that's what happened.
speedfilter needs a max.speed in metres per hour if it's projected, but in km per hour if it's in longlat.
The code behind
R summary(trip)
then reports mean/max speeds in metres per hour if it's projected, or km per hour if it's in longlat.
Reported by Anthony Fischbasch