Skip to content
Animate GPX data on a 3D map
R
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
R update docs to pass package check Nov 6, 2019
data update docs to pass package check Nov 6, 2019
inst update docs to pass package check Nov 6, 2019
man update docs to pass package check Nov 6, 2019
vignettes update docs to pass package check Nov 6, 2019
.Rbuildignore update docs to pass package check Nov 6, 2019
.gitignore
.travis.yml update docs to pass package check Nov 6, 2019
DESCRIPTION update docs to pass package check Nov 6, 2019
NAMESPACE update docs to pass package check Nov 6, 2019
README.md fix issue #1 Nov 7, 2019
_pkgdown.yml update docs to pass package check Nov 6, 2019
readme.txt added a function to animate on rayshader plot3d Nov 4, 2019

README.md

Build Status

rayshaderanimate

A package to animate a GPX path on a 3d landscape - with rayshader

Purpose

This package shall be used to create a 3d flyover video of a GPX path. You can imagine a cycling trip or a hike. You did it with a GPX tracker. This data shall now be plotted onto a 3d landscape. This is what this package will do for you.

As an example the package contains one of my cycling trips at the 21 hard hairpin bends of Alpe d'Huez. You can go through the vignette of this package which explains How to create the video? or read my blog article about the package.

Final videos

as a gif

as a mp4

https://www.youtube.com/watch?v=iEqoR-HpKeU

Functionality

Getting started:

devtools::install_github("zappingseb/rayshaderanimate")

How to create a video?

Please go step by step through the vignette: How to create the video?.

API

GPX read functions

Read in a gpx file to a table

get_table_from_gpx()

Enrich the table with distance and speed measures. Convert it to a boundary box

get_enriched_gpx_table()

get_bbox_from_gpx_table()s

Elevation data functions

Elevation data can be downloaded from SRTM or be directly added by an EUDEM file.

el_mat <- get_elevdata_from_bbox()

el_mat_eudem <- get_elevdata_from_bbox(bbox = bbox,
  type ="EUDEM",
  file = "eu_dem_v11_E40N20/eu_dem_v11_E40N20.TIF")
  
get_elevdata_long(el_mat)

Output plot functions

Two functions are provided for 2D outputs within this package:

# Animate GPX line on 2d plot
plot_2d_animation()

# Plot a 2D raster of the bbox
plot_2d_elevdata()

Creating a video

To create a video there is just the function video_animation() which will do the most important job of this package. Rendering the video.

To create a video on shere shades there is the function video_animation_rayshade() which will render an even nicer story video:

You can’t perform that action at this time.