shud.mesh | R Documentation |
shud.mesh
Generate the mesh data from the triangulation
shud.mesh
shud.mesh(tri, dem, AqDepth = 10, r.aq = dem * 0 + AqDepth)
tri |
Triangles defination |
dem |
Elevation. Projection of the DEM raster must be same as watershed boundary. |
AqDepth |
Aquifer depth, numeric. |
r.aq |
Aquifer Thickness. Raster object |
Triangle mesh of model domain.
library(raster)
data(sac)
wbd=sac[['wbd']]
dem=sac[['dem']]
a.max = 1e6 * 1;
q.min = 33;
tol.riv = 200
tol.wb = 200
tol.len = 500
AqDepth = 10
wbbuf = rgeos::gBuffer(wbd, width = 2000)
dem = raster::crop(dem, wbbuf)
wb.dis = rgeos::gUnionCascaded(wbd)
wb.simp = rgeos::gSimplify(wb.dis, tol=tol.wb, topologyPreserve = TRUE)
tri = shud.triangle(wb=wb.simp,q=q.min, a=a.max)
plot(tri, asp=1)
# generate SHUD .mesh
pm=shud.mesh(tri,dem=dem, AqDepth = AqDepth)
sm = sp.mesh2Shape(pm)
raster::plot(sm)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.