Learn R Programming

eRTG3D

The empirically informed Random Trajectory Generator in three dimensions (eRTG3D) is an algorithm to generate realistic random trajectories in a 3-D space between two given fix points, so-called Conditional Empirical Random Walks. The trajectory generation is based on empirical distribution functions extracted from observed trajectories (training data) and thus reflects the geometrical movement characteristics of the mover. A digital elevation model (DEM), representing the Earth's surface, and a background layer of probabilities (e.g. food sources, uplift potential, waterbodies, etc.) can be used to influence the trajectories.

The eRTG3D algorithm was developed and implemented as an R package within the scope of a Master's thesis (Unterfinger, 2018) at the Department of Geography, University of Zurich. The development started from a 2-D version of the eRTG algorithm by Technitis et al. (2016).

Getting started

# Install release version from CRAN
install.packages("eRTG3D")

# Install development version from GitHub
remotes::install_github("munterfi/eRTG3D")

Features

The eRTG3D package contains functions to:

  • calculate movement parameters of 3-D GPS tracking data, turning angle, lift angle and step length
  • extract distributions from movement parameters;
    1. P probability - The mover's behavior from its perspective
    2. Q probability - The pull towards the target
  • simulate Unconditional Empirical Random Walks (UERW)
  • simulate Conditional Empirical Random Walks (CERW)
  • simulate conditional gliding and soaring behavior of birds between two given points
  • statistically test the simulated tracks against the original input
  • visualize tracks, simulations and distributions in 3-D and 2-D
  • conduct a basic point cloud analysis; extract 3-D Utilization Distributions (UDs) from observed or simulated tracking data by means of voxel counting
  • project 3-D tracking data into different Coordinate Reference Systems (CRSs)
  • export data to sf package objects; 'sf, data.frames'
  • manipulate extent of raster layers

Contributing

Contributions to this package are very welcome, issues and pull requests are the preferred ways to share them. Please see the Contribution Guidelines.

This project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms.

References

Unterfinger M (2018). 3-D Trajectory Simulation in Movement Ecology: Conditional Empirical Random Walk. Master's thesis, University of Zurich.

Technitis G, Weibel R, Kranstauber B, Safi K (2016). “An algorithm for empirically informed random trajectory generation between two endpoints.” GIScience 2016: Ninth International Conference on Geographic Information Science, 9, online. doi: 10.5167/uzh-130652.

Copy Link

Version

Install

install.packages('eRTG3D')

Monthly Downloads

258

Version

0.7.0

License

GPL-3

Issues

Pull Requests

Stars

Forks

Maintainer

Merlin Unterfinger

Last Published

February 25th, 2022

Functions in eRTG3D (0.7.0)

get.section.densities.3d

Extract tldCube and autodifferences functions from track sections
get.glideRatio.3d

Calculate glide ratio
chiMaps

Chi maps of two variables
dem

Example digital elevation model (DEM)
n.sim.glidingSoaring.3d

Simulates multiple 'gliding & soaring' tracks with a given number of gliding steps
niclas

Example track data.frame
get.densities.3d

Extract tldCube and autodifference approximation functions
filter.dead.ends

Remove dead ends
dem2track.extent

Crops the DEM to the extent of the track with a buffer
dist2point.3d

Distance of each track point to a given point
parpbapply

Parallel apply with progressbar
plot3d

Plot track(s) with a surface of a digital elevation model in three dimensions
parpblapply

Parallel lapply with progressbar
get.track.densities.3d

Extract tldCube and autodifferences functions from a consistent track
is.sf.3d

Tests if the object is a simple feature collection (class: 'sf, data.frame')
dist2target.3d

Distance to target
lift2target.3d

Lift angle to target
eRTG3D

eRTG3D: Empirically Informed Random Trajectory Generator in 3-D
plotRaster

Plots a rasterLayer or rasterStack
logRasterStack

Converts a rasterStack to logarithmic scale
saveImageSlices

Export a dataCube as image slice sequence
sim.cond.3d

Conditional Empirical Random Walk (CERW) in 3-D
sf2df.3d

Converts a sf data.frame to a normal dataframe
reproduce.track.3d

Reproduce a track with the eRTG3D
plot3d.multiplot

Multiple plot function for ggplot objects
test.verification.3d

Statistical Verification of the simulated track
movingMedian

Moving median in one dimension
voxelCount

Apply voxel counting on a point cloud
plot3d.tldCube

Visualize turn-lift-step histogram
track.extent

Extent of track(s)
turn2target.3d

Turn angle to target
turnLiftStepHist

Three dimensional histogram
track.properties.3d

Track properties of a 3-D track
qProb.3d

Q probabilities for n steps
track.split.3d

This function splits the by outliers in the time lag.
test.eRTG.3d

Test the functionality of the eRTG3D
sim.uncond.3d

Unconditional Empirical Random Walk (UERW) in 3-D
plot3d.densities

Density plots of turn angle, lift angle and step length
track2sf.3d

Converts a track to a 'sf, data.frame'
transformCRS.3d

Transform coordinates reference system (CRS) of a 3-D track
parpbsapply

Parallel sapply with progressbar
plot2d

Plot function to plot the 3-D tracks in 2-D plane
n.sim.cond.3d

Conditional Empirical Random Walks (CERW) in 3-D
sim.crw.3d

Simulation of a three dimensional Correlated Random Walk
sim.glidingSoaring.3d

Simulates 'gliding & soaring' track with a given number of gliding steps