sfx <- silicate::inlandwaters[6, ]
## devtools::install_github("hypertidy/anglr") ## in desperate need of reboot, alignment with wk/geos etc.
ps <- anglr::as_pslg(sfx)
tr <- triangulate(ps)
plot(tr$VP, pch = ".")
plot(tr, add = TRUE)
points(tr$VP, pch = "+")
E <- tr$VE[tr$VE[,2] > 0, ]
lines(tr$VP[t(cbind(E, NA)), ], col = "red", lwd = 2)
Created
August 28, 2024 11:14
-
-
Save mdsumner/8db5ac01e47fa86f10e7ebc372e0ebda to your computer and use it in GitHub Desktop.
all with terra
## do it all with terra
library(terra)
#> terra 1.7.81
f <- system.file("ex/lux.shp", package="terra")
v <- vect(f)
vo <- voronoi(v)
plot(intersect(v, vo))
plot(intersect(aggregate(v), voronoi(aggregate(v))))
Created on 2024-08-29 with reprex v2.0.2
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
plot(ts)
Created on 2024-08-29 with reprex v2.0.2