Fix the POS column of a PolySet by recalculating it using sequential integers.
fixPOS (polys, exteriorCCW =NA)
Arguments
polys: PolySet to fix.
exteriorCCW: Boolean value; if TRUE, orders exterior polygon vertices in a counter-clockwise direction. If FALSE, orders them in a clockwise direction. If NA, maintains their original order.
Details
This function recalculates the POS values of each (PID, SID) as either 1 to N or N to 1, depending on the order of POS (ascending or descending) in the input data. POS
values in the input must be properly ordered (ascending or descending), but they may contain fractional values. For example, POS = 2.5 might correspond to a point manually added between POS = 2 and POS = 3. If exteriorCCW = NA, all other columns remain unchanged. Otherwise, it orders the X and Y columns according to exteriorCCW.
Returns
PolySet with the same columns as the input, except for possible changes to the POS, X, and Y columns.