3D models of places in the UK created with rayshader R package.
For installation instructions see here. Follow this very extensive tutorial or browse the rayshader website to learn more about creating 3D plots in R.
For UK related lidar data, there is a very good, publicly available resource here. The data used for the examples in this repository comes from there. Which exact tiles were used is described in the R scripts.
The resource above will give you a bunch of asc files that need to be turned into a matrix that can be plotted by rayshader. This is achieved using the code below. Assuming you placed all the asc files into your working directory, run
raster_layers <- tibble(filename = list.files(path = getwd(),"*.asc$")) %>%
mutate(raster =
map(filename, .f = ~raster::raster(rgdal::readGDAL(.)))
) %>%
pull(raster)
# Combine raster layers
raster_layers$fun <- mean
raster_mosaic <- do.call(raster::mosaic, raster_layers)
plottable_matrix <- raster_mosaic%>%
raster_to_matrix()%>%
reduce_matrix_size(0.5)
The last line reduce_matrix_size
is not necessarily needed, but depending
on the size of your matrix you probably will want to run it to save some resources.
Warwick University Campus with labelled points of interest.