View source: R/check_polygon.R
| check_polygon | R Documentation |
This function converts a data.frame of polygon vertices into an sf POLYGON and checks its validity. If the polygon is invalid, it attempts to fix it.
check_polygon(core_polygon_df, trees_inv, sensors = NULL, verbose = TRUE)
core_polygon_df |
A data.frame with columns x and y defining polygon vertices |
trees_inv |
A data.frame with one row per tree. See check_inventory for the required structure and validated columns. |
sensors |
Optional data.frame defining position and height of the sensor within the stand. See check_sensors for the required structure and validated columns. |
verbose |
Logical. If TRUE, warnings are printed |
A data.frame of polygon vertices (x, y):
unchanged if valid
modified if fixed (with a warning)
data_prenovel <- SamsaRaLight::data_prenovel
# Validate polygon
check_polygon(data_prenovel$core_polygon, data_prenovel$trees)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.