Skip to main content

validate_compactness

Function validate_compactness 

Source
pub fn validate_compactness(
    twice_area: u128,
    perimeter: u128,
    config: &ProtocolConfig,
) -> Option<String>
Expand description

Validate compactness using the isoperimetric ratio, returning a string error on failure. Thin wrapper around check_compactness for callers that want a human-readable message instead of a structured TopologyError.

Apply this to a polygon boundary (whole single-part polygon, or outer boundary of a multipart polygon). Do NOT call on an isolated part.