There are time functions in the trip
package (I am the author). You can create objects from track data that understand the process of the base track over time, and simply process points that assume straight lines between corrections. If "home" is the largest pixel of the value, i.e. When you split all segments based on the length of time and sum them into cells, then it's easy to find it. Tracing time using the tripGrid
function is equal to SpatialGridDataFrame
with standard sp
package classes, and a trip object can consist of one or more tracks.
Using rgdal
, you can easily convert the coordinates to the corresponding map projection if lon / lat is not suitable for your length, but this has nothing to do with calculating grid segments / time.
There is a simple speedfilter
for removing fixes that involve moving too fast, but it is very simple and may introduce new problems, in general updating or filtering tracks for an unlikely move can be very difficult. (In my experience, most of the time spent in the grid gives you the same rating as many complex models that just open up new challenges). The filter works with Cartesian or long / lat coordinates, using tools in sp
to calculate distances (long / lat is reliable, while poor selection of the map projection can introduce problems - at short distances, such as people on earth, it probably doesnโt have of great importance)
(The tripGrid
function computes the exact components of line segments using pixellate.psp
, but this detail is hidden in the implementation).
From the point of view of data preparation, trip
strictly adheres to a reasonable sequence of times and will not allow you to create an object if the data has duplicates, fails, etc. There is an example of reading data from a text file in ?trip
, and a very simple example with (really) dummy data:
library(trip) d <- data.frame(x = 1:10, y = rnorm(10), tms = Sys.time() + 1:10, id = gl(1, 5)) coordinates(d) <- ~x+y tr <- trip(d, c("tms", "id")) g <- tripGrid(tr) pt <- coordinates(g)[which.max(g$z), ] image(g, col = c("transparent", heat.colors(16))) lines(tr, col = "black") points(pt[1], pt[2], pch = "+", cex = 2)
There are no overlapping areas in this dummy track, but it shows that finding the maximum point in the โelapsed timeโ is quite simple.