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:
- Confirm the problem quickly.
- Fix it using the Editor, not the validator.
- Validate the result.
- Export clean WKT or GeoJSON.
What “hole outside outer ring” means (in plain terms)
A polygon can have:
- One outer ring. The boundary.
- Zero or more inner rings. Holes that subtract area.
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:
- A ring that belongs somewhere else.
- A separate polygon area.
- A ring that was moved by a bad edit or conversion.
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
- Validator errors like Hole outside outer ring or Interior ring not contained by outer ring.
- A hole that appears far away from the polygon when rendered.
- Buffer, union, clip, or export to Shapefile failing, or producing empty output.
Quick diagnostic. Confirm it is a hole containment issue
- Open WKT Validator or GeoJSON Validator.
- Paste your geometry.
- 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:
- It is a real hole. Move it inside the outer ring.
- It is a real area. Make it a separate polygon, usually a MultiPolygon.
Option A. Move the hole inside the outer ring
Use this if the inner ring is meant to subtract area from the outer polygon.
- Open the Editor and paste or import the geometry.
- Zoom until you can see both the outer polygon and the misplaced hole.
- Edit the geometry and move the hole ring vertices so the whole hole sits inside the outer ring.
- Save the edit.
- 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.
- Open the geometry in the Editor.
- Recreate the second area as its own polygon.
- Keep both polygons as two separate geometries, or export as a single MultiPolygon if your pipeline wants one feature.
- 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:
- The outer ring and holes are all over the place.
- There are multiple errors, not just hole containment.
- The polygon outline looks wrong.
Steps:
- Keep the broken geometry as a visual reference.
- Trace a new polygon with correct holes.
- Delete the broken one.
- 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:
- Re-run validation (WKT or GeoJSON).
- Visually confirm the hole sits inside the polygon and looks intended.
- Sanity-check bounds and area.
If validation still fails, check for other common issues:
- Self-intersections.
- Ring not closed.
- Zero-area rings.
- Duplicate rings.
- Wrong winding for holes and outers.
Prevention checklist
- When digitizing, create holes inside the polygon boundary and avoid touching edges.
- Avoid copy-pasting rings between features without checking containment.
- Validate after conversions, especially Shapefile to GeoJSON, GeoJSON to WKT, and MultiPolygon operations.
- If you transform CRS, verify the CRS first. A wrong CRS can move rings far away.
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
validation
Fix a Zero-Area Polygon Ring (Degenerate) (WKT and GeoJSON)
A zero-area ring is a degenerate polygon. Learn how to spot it, remove or repair it in a browser, validate the result, and export clean WKT or GeoJSON.
validation
Fix a Polygon Ring That Is Not Closed (WKT and GeoJSON)
A polygon ring must end where it starts. Learn how to spot an unclosed ring, close it correctly in WKT or GeoJSON, validate the result, and export clean geometry.
validation
Fix a Self-Intersecting Polygon (WKT and GeoJSON)
Self‑intersections (“bowties”) make polygons invalid. Learn how to detect the crossing, repair it in a browser, validate the result, and export clean WKT or GeoJSON.