Skip to content

Main content

Polygon Hole Count From Rings Tool

Calculate polygon hole count from rings from explicit caller-supplied inputs.

Loading tool…

Description

Return max(0, rings-1) as holes and exteriorPresent when rings is positive.

A polygon ring is a closed sequence of coordinate positions. Closure, minimum position count, distinct vertices, winding, and self-intersection are separate properties, so a check of one cannot stand in for complete polygon validation.

Return max(0, rings-1) as holes and exteriorPresent when rings is positive.

When to use this tool

Use Polygon Hole Count From Rings when you need a specific ring-shape or closure diagnostic.

How to use the tool and how it works

  1. Enter rings. Use the units and conventions below.
  2. Run the tool. Correct any format, range, or cross-field input error before interpreting the output.
  3. Read holes, exteriorPresent. Inspect exteriorPresent before interpreting the associated values.

Require nonnegative integer rings. Return max(0, rings-1) as holes and exteriorPresent when rings is positive.1

Input fieldMeaning and unitsAccepted input
ringsRingsRequired. Safe integer; minimum 0.
Output fieldInterpretationReturned shape
holesHolesRequired. Safe integer.
exteriorPresentExterior PresentRequired. Boolean.
json
{
  "input": {
    "rings": 4
  },
  "output": {
    "holes": 3,
    "exteriorPresent": true
  }
}

Limitations and assumptions

  • This interprets the first supplied ring count as exterior under the model; it does not inspect nested geometry, verify holes, or establish valid containment and winding.
  • Inputs must satisfy both the field types and the cross-field conditions above. Invalid input causes an error; a successful false flag or documented placeholder is a different result.
  • Numeric calculations use binary floating point unless exact decimal-integer arithmetic is explicitly stated. No hidden measurement tolerance or decimal rounding is added; nonfinite or out-of-contract results are rejected. Numeric signed-zero results are exported as zero.

Alternative or Complementary methods

Use a complete GeoJSON and polygon validator for publication or geometric operations. Check coordinate convention, distinctness, winding, self-intersection, and hole relationships as appropriate.

References

  1. Calculation and input contract: geojson/polygon-hole-count-from-rings — tool.io

Similar or alternative tools