Releases: AustralianAntarcticDivision/rema.proc
Releases · AustralianAntarcticDivision/rema.proc
mesh01
Zipped RDS file from R, containing a mesh3d object.
Usage:
library(rgl)
mesh <- readRDS("file1964727b4483.rds")
wire3d(mesh)
aspect3d("iso") # # if the aspect ratio is bad
## to colourize the mesh by elevation (for a surface)
mesh$material$color <- colourvalues::colour_values(mesh$vb[3, ])
mesh$meshColor <- "vertices"
plot3d(mesh)
What is in the file?
We extract a trimmed down window from REMA 8m by using a GeoTIFF of the dry valleys from the internet
raadtools is an data library package we use in-house, but otherwise raadtools::topofile("rema_8m")
is just the path to a VRT that links the 1516 REMA GeoTIFF tiles as a single file.
## GeoTIFF from https://maps.apps.pgc.umn.edu/id/132
img <- raster::brick("cMurdo Dry Valleys ASMA No 2.tif")
## we are honing into the right extract of REMA using the image above (different projections)
elev_lazy <- lazyraster::lazyraster(raadtools::topofile("rema_8m"))
ext <- projectExtent(img, "+proj=stere +lat_ts-71 +lat_0=-90 +datum=WGS84")
library(lazyraster)
## as_raster from lazyraster gives us the detail we ask for
topo <- as_raster(crop(elev_lazy, ext), c(4096, 4096))
Then with anglr and terrainmeshr we make a triangle mesh, the mesh has more detail where it's required, so we save on converting every pixel to a quad
mesh <- as.mesh3d(topo)
mesh
## this is the object in the RDS file attached here
mesh3d object with 2096310 vertices, 698770 triangles and 0 quads.