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.
Arguments
- 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
Examples
data_prenovel <- SamsaRaLight::data_prenovel
# Validate polygon
check_polygon(data_prenovel$core_polygon, data_prenovel$trees)
#> Polygon successfully validated.
#> x y
#> 1 0 0
#> 2 100 0
#> 3 100 100
#> 4 0 100