Helper function to provide the minimum rotated bounding rectangle of a polygon or set of points. Optionally, the function will return the bearing angle in degrees from vertical in a clockwise direction.

fs_mbr(X, returnShape = FALSE)

Arguments

X

polygons of building footprints in type sf.

returnShape

logical. Should the function return the sf polygon of the rotated bounding rectangle or should it return the angle (in degrees).

Value

a numeric angle from 0 to 360 degrees or the rotated rectangle as a polygon of type sf.