video_animation
3D轨迹动画 R语言rayshaderanimate包
R语言读取gpx文件
# Fri Oct 29 11:50:58 2021 edit
# 字符编码:UTF-8
# R 版本:R 4.1.1 x64 for window 11
# [email protected]
# 个人笔记不负责任,拎了个梨
#.rs.restartR()
require()
rm(list = ls());gc()
# devtools::install_github("zappingseb/rayshaderanimate")
require(rayshaderanimate)
gpx <- get_table_from_gpx(gpx_file_loc = '植帽牛只供参考.gpx')
dt <- get_enriched_gpx_table(gpx)
#读取高程,下载高程 Fri Oct 29 14:03:51 2021 ------------------------------
# el_mat_eudem <- get_elevdata_from_bbox(bbox = bbox,
# type ="EUDEM",
# file = "eu_dem_v11_E40N20/eu_dem_v11_E40N20.TIF")
# dt.dem <- get_elevdata_from_bbox(dt |> get_bbox_from_gpx_table())
saveRDS(dt.dem,file = 'dt.dem.Rds')
readRDS('dt.dem.Rds')
#2D平面预览。 Fri Oct 29 14:04:17 2021 ------------------------------
plot_2d_animation(
dt |> get_enriched_gpx_table(), # 轨迹表
dt.dem |> get_elevdata_long() # 高程表
)
# Fri Oct 29 14:07:35 2021 ---
#3D预览 Fri Oct 29 14:08:20 2021 ------------------------------
video_animation (
dt |> get_enriched_gpx_table(), # 轨迹表
dt.dem |> get_elevdata_long() # 高程表
# , output_file_loc ='001.mp4'
,number_of_screens=5
)