A package to animate a GPX path on a 3d landscape - with rayshader
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.
as a gif
as a mp4
How to create a video?
Please go step by step through the vignette: How to create the video?.
GPX read functions
Read in a gpx file to a table
Enrich the table with distance and speed measures. Convert it to a boundary box
Elevation data functions
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: