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