Comments (1)
Here is the solution I've send you as reply to your mail:
library(moveVis)
library(move)
library(magrittr)
library(lubridate)
pdfhrecenttracks <- read.csv("pdfhrecenttracks.csv", stringsAsFactors = F)
pdfhrecenttracks$time <- as.POSIXct(pdfhrecenttracks$time, format="%Y-%m-%d %H:%M:%S", tz="UTC")
# align movement
m.move <- move(x=pdfhrecenttracks$location.long, y=pdfhrecenttracks$location.lat, time=pdfhrecenttracks$time,
data=pdfhrecenttracks, proj=CRS("+proj=longlat +ellps=WGS84 + towgs84=0,0,0"), animal=pdfhrecenttracks$trackId, sensor=pdfhrecenttracks$sensor)
# remove those tracks that consist of only one location, these cannot be aligned, minimum of 2 locations is required for interpolation
m.move <- m.move[[sapply(split(m.move), length) > 1]]
# choose a resolution not to far from your sampling intervalls, e.g. 1 day, since the median of all time lags is nearly 24 hours
# For example:
res <- m.move %>%
timeLag(units = "secs") %>%
sapply(function(x) (median(x)/60)/60) %>%
median() %>%
round()
m <- align_move(m = m.move, res = res, unit = "hours")
#Get unique colors -----------
n <- n.indiv(m)
color = grDevices::colors()[grep('gr(a|e)y', grDevices::colors(), invert = T)]
unique.colors <- sample(color, n)
pie(rep(1,n), col=unique.colors)
frames <- frames_spatial(m, path_colours = unique.colors, map_service = "osm", map_type = "watercolor", alpha = 0.5,
path_legend = F) %>%
add_labels(x = "Longitude", y = "Latitude") %>% # add some customizations, such as axis labels
add_northarrow() %>%
add_scalebar() %>%
add_timestamps(m, type = "label") %>%
add_progress()
animate_frames(frames, out_file = "test.gif", overwrite = T)
Pleas reopen, if anything is unclear.
from movevis.
Related Issues (20)
- spaceMethod error
- Only MapBox satellite basemap is working (I already tried the solutions previously posted). HOT 3
- Custom Imagery Raster Plotting
- the coordinate reference system of 'm' is not geographical (long/lat)
- Possible to overlay tracks on top of special features (e.g. polygons)?
- align_move suddenly throws error HOT 1
- Change to new cran checks badge URL HOT 1
- error in frames_spatial() when creating frames for more than 20 tracks HOT 3
- `align_move` does not preserve data (colour) column HOT 2
- osm maps dont load
- animate_frames() `end_pause` broken HOT 1
- Dateline crossing HOT 1
- frames_spatial() cropping issue? HOT 1
- Error creating animation: Error in .x[["expr"]][[i]]: subscript out of bounds HOT 5
- Basemap are not correctly rendered HOT 12
- Error message: there is no package called โmoveVisโ
- Fatal Error from frame_spatial HOT 6
- namespace:terra issue
- Categorical raster not displaying properly
- crossing dateline issue
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ๐๐๐
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from movevis.