ClearSKY FaviconClearSKY Polygon Tools

Fix a Hole Outside the Outer Ring (WKT and GeoJSON)

2026-01-07 · 5 min read · WKT · GeoJSON · validation · polygon · hole · interior-ring · GIS

A hole must sit inside its outer ring. Learn how to detect a hole outside the outer ring, fix it in the browser, validate the result, and export clean WKT or GeoJSON.

Try it now

A hole outside the outer ring means one of your interior rings is not contained by the polygon boundary.
Most validators will reject the geometry, and many GIS operations will fail or return strange results.

This guide shows a practical way to:


What “hole outside outer ring” means (in plain terms)

A polygon can have:

A hole is only valid if it is fully inside the outer ring.
If a hole sits outside, it is not a hole. It is either:

Important: A validator should detect this problem. It should not guess how to fix it.
Fixing it requires a topology decision, so you should do it in the Editor.

Typical symptoms


Quick diagnostic. Confirm it is a hole containment issue

  1. Open WKT Validator or GeoJSON Validator.
  2. Paste your geometry.
  3. If you see an error like “hole(s) are outside their outer ring”, you are in the right place.

Minimal example. WKT with a hole placed outside

Outer ring is a square from (0,0) to (6,6).
Hole ring is around (10,10). That is outside, so it is invalid.

POLYGON(
  (0 0, 6 0, 6 6, 0 6, 0 0),
  (10 10, 11 10, 11 11, 10 11, 10 10)
)

Minimal example. GeoJSON with a hole placed outside

{
  "type": "Polygon",
  "coordinates": [
    [[0, 0], [6, 0], [6, 6], [0, 6], [0, 0]],
    [[10, 10], [11, 10], [11, 11], [10, 11], [10, 10]]
  ]
}

Fix it in the browser (ClearSKY Polygon Tools)

You typically have two correct outcomes. Pick the one that matches what you meant:

Option A. Move the hole inside the outer ring

Use this if the inner ring is meant to subtract area from the outer polygon.

  1. Open the Editor and paste or import the geometry.
  2. Zoom until you can see both the outer polygon and the misplaced hole.
  3. Edit the geometry and move the hole ring vertices so the whole hole sits inside the outer ring.
  4. Save the edit.
  5. Validate again in WKT Validator or GeoJSON Validator.

Rule of thumb: Do not “stretch” a hole across the boundary. A hole should be clearly inside.

Option B. Convert the “hole” into a separate polygon

Use this if the inner ring is actually a second area, not a hole.

  1. Open the geometry in the Editor.
  2. Recreate the second area as its own polygon.
  3. Keep both polygons as two separate geometries, or export as a single MultiPolygon if your pipeline wants one feature.
  4. Validate again.

This is often the right answer after conversions, where rings were grouped incorrectly.

Option C. Rebuild the polygon if rings are mixed up

Use this if:

Steps:

  1. Keep the broken geometry as a visual reference.
  2. Trace a new polygon with correct holes.
  3. Delete the broken one.
  4. Validate and export.

Special cases you should not miss

A hole touching the outer boundary is usually invalid

If a hole touches the outer ring at a point or along an edge, many validators treat it as invalid topology.
Keep a small separation between hole and boundary.

Wrong coordinate order can make the hole “jump”

If you have swapped coordinates, for example using lat,lon instead of lon,lat, rings can end up far away.
Check the validator warnings about lon and lat ranges.

MultiPolygon means more containment checks

In a MultiPolygon, each polygon part has its own outer ring and holes.
A hole must be inside the outer ring of its own polygon part, not inside some other part.


Validate the fixed result (do not skip this)

After any fix:

  1. Re-run validation (WKT or GeoJSON).
  2. Visually confirm the hole sits inside the polygon and looks intended.
  3. Sanity-check bounds and area.

If validation still fails, check for other common issues:


Prevention checklist


FAQ

Why can’t the validator fix this automatically?

Because there are multiple valid interpretations. The ring might be a real hole that was shifted, or it might be a separate polygon area that was incorrectly stored as a hole. A validator should detect and explain, not guess your intent.

Is a hole outside the outer ring always an error?

Yes for Polygon topology. An interior ring is only valid as a hole if it is fully contained by its outer ring. If it is outside, it is not a valid hole.

What if the hole is inside, but the validator still complains?

Check for holes that touch the boundary, holes that self-intersect, or rings that are not closed. Also check for coordinate order and CRS issues that can make the rendered view misleading.

What if I actually intended two separate areas?

Then you likely want a MultiPolygon or two separate polygons. Treat the second ring as its own polygon area, not as a hole.

Do holes need a specific winding direction?

Many tools follow RFC 7946. Outer rings are usually counter-clockwise and holes clockwise. Your geometry can still be “contained” but produce odd results if winding is inconsistent. The validator can warn about winding so you can normalize it.

Related resources

Related guides