points_to_mesh | R Documentation |
Convert sfc_POINTS to a mesh of polygons (delaunay triangulation)
points_to_mesh(
x,
method = c("geometry", "sf")[1],
varname = NULL,
fun = mean,
...
)
x |
sf object with geometry of type POINT |
method |
charcater, 'geometry' (default) or 'sf' |
varname |
character one or more variable names to transfer to the polygon Ignored if method is not 'geometry' |
fun |
function to compute value the variables specifed by varname Ignored if method is not 'geometry' |
... |
other arguments for |
sf POLYGON table is method is 'geometry' and sf GEOMETRYCOLLECTION otherwise
delaunayn
## Not run:
pts <- sf::read_sf(system.file("datasets/penbay-points.gpkg", package = 'twinkle'))
mesh <- points_to_mesh(pts)
sst <- stars::read_stars(system.file("datasets/20140601-20140630-sst.tif", package = "twinkle"))
plot(sst[,,,1],
main = "sst 2014-01-01",
reset = FALSE,
add.geom = list(sf::st_geometry(pts), col = 'orange', pch = 19))
plot(sf::st_geometry(mesh), add = TRUE, border = 'green')
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.