View source: R/utils_shapefile.R
line_on_halfplot | R Documentation |
For each polygon in an sf
object, computes the line segment joining
the midpoints of the longer pair of opposite edges (the “half‐plot line”).
line_on_halfplot(shapefile)
shapefile |
An |
A SpatVector
(from the terra package) of line geometries
representing the half‐plot midlines.
if(interactive()){
library(pliman)
shp <- shapefile_input( paste0(image_pliman(), "/soy_shape.rds"))
mosaic <- mosaic_input( paste0(image_pliman(), "/soy_dsm.tif"))
mosaic_plot(mosaic)
half <- line_on_halfplot(shp)
shapefile_plot(half, add = TRUE, col = "blue")
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.