ClearSKY FaviconClearSKY Polygon Tools

Fix a Polygon Ring That Is Not Closed (WKT and GeoJSON)

2026-01-06 · 5 min read · WKT · GeoJSON · validation · polygon · ring · closed-ring · GIS

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.

Try it now

A polygon ring is not closed when the last coordinate in a ring does not match the first coordinate.
Most validators will reject the geometry, and many GIS tools will refuse to process it.

This guide shows a practical way to:


What “ring not closed” means (in plain terms)

A polygon is made of one or more linear rings:

For a ring to be valid, it must start and end on the same coordinate.
In other words, the first and last coordinate must be identical, including the same X and Y values.

Typical symptoms


Quick diagnostic. Confirm it is an unclosed ring

  1. Open WKT Validator (or GeoJSON Validator).
  2. Paste your geometry.
  3. If you see a ring closure error, you are in the right place.

Minimal example. WKT polygon with an unclosed ring

This example is missing the closing point at the end.

POLYGON((0 0, 2 0, 2 2, 0 2))

A correct closed version repeats the first coordinate at the end.

POLYGON((0 0, 2 0, 2 2, 0 2, 0 0))

Minimal example. GeoJSON polygon with an unclosed ring

In GeoJSON, each ring is an array of coordinates. The first coordinate must equal the last.

{
  "type": "Polygon",
  "coordinates": [
    [
      [0, 0],
      [2, 0],
      [2, 2],
      [0, 2]
    ]
  ]
}

Correct closed version:

{
  "type": "Polygon",
  "coordinates": [
    [
      [0, 0],
      [2, 0],
      [2, 2],
      [0, 2],
      [0, 0]
    ]
  ]
}

Fix it in the browser (ClearSKY Polygon Tools)

Option A. Close the ring by copying the first coordinate

This is the usual fix when everything else looks correct.

  1. Open the Editor and paste or import your geometry.
  2. Find the first coordinate of the ring.
  3. Make the last coordinate equal to the first coordinate.
  4. Re-run WKT Validator or GeoJSON Validator.

Rule of thumb: Only add the closing point. Do not reorder points unless you know the ring is wrong.

Option B. Rebuild the polygon if the ending point is not the real start

Sometimes the last point is not “missing.” Sometimes the ring is in a weird order, duplicated, or partially broken.

Use this if:

Steps:

  1. Use the broken polygon as a visual reference.
  2. Trace a new polygon with clean edges.
  3. Delete the broken one.
  4. Validate and export.

Special cases you should not miss

Holes must be closed too

If your polygon has holes, every hole ring must be closed, not just the outer ring.

WKT holes example, outer ring plus one hole ring. Both rings must end where they start.

POLYGON(
  (0 0, 6 0, 6 6, 0 6, 0 0),
  (2 2, 4 2, 4 4, 2 4, 2 2)
)

MultiPolygon means more rings to check

If you have a MultiPolygon, each polygon has its own outer ring, and optionally holes.
Every ring inside the MultiPolygon must be closed.


Validate the fixed result (do not skip this)

After any fix:

  1. Re-run validation (WKT or GeoJSON).
  2. Visually confirm the outline looks right.
  3. Sanity-check bounding box and area. If they look extreme, you may have a CRS or coordinate issue.

If validation still fails, check for other common problems:


Prevention checklist


FAQ

Do I need to close rings in both WKT and GeoJSON?

Yes. Both formats represent rings, and rings must be closed to be valid. In WKT, it means repeating the first coordinate at the end of the ring. In GeoJSON, it means the last coordinate in the ring array must equal the first.

My polygon renders fine. Why does the validator still complain?

Some renderers try to be forgiving, but validators are strict. Many downstream operations and file formats assume valid geometry. If the ring is not closed, you can get failures later, or you can get subtle wrong results.

Should I add the first point again, or should I move the last point?

Add the first point again if the rest of the ring is correct. Move the last point only if you are sure the last point was meant to be the start point and the ring ordering is already correct.

What if the first and last points are almost the same but not identical?

Validators usually require exact equality. If you have a tiny difference, treat it as not closed. Copy the first coordinate exactly. If the near match is caused by rounding or precision loss, export with enough decimals to preserve the original coordinates.

Is a ring closure error the same as a self-intersection?

No. Ring closure is about the start and end point matching. A self-intersection happens when edges cross somewhere along the ring. You can have a closed ring that still self-intersects, and you can have an unclosed ring with no crossings.

Related resources

Related guides