Clean management units (UG) by correcting minor inconsistencies in the UA sf object
ua_clean_ug.RdDetects and corrects minor inconsistencies within management units (UG) in UA. Lines with small surfaces relative to their UG are updated to match the dominant description.
Value
An sf object identical to ua, with minor inconsistent lines
corrected and an additional logical column ug_valid indicating UG
consistency.
Details
The function works by:
Checking UG consistency with
ua_check_ug().Identifying the dominant row per UG (largest total surface).
Correcting rows that differ from the dominant description and whose surface is smaller than
atoland represents less thanrtolof UG total.Returning the corrected UA and rechecking inconsistencies.