Atlas · Rwanda / Methodologies
METHODOLOGIES

Repairing invalid geometry

Self-intersecting or broken polygons are repaired with ST_MakeValid and counted, so none are silently dropped.

Advanced 1 min read geometryPostGISquality

A polygon is invalid when, for example, its boundary crosses itself, two rings overlap, or it has too few points. Invalid shapes break area calculations and spatial queries.

What Atlas does

  1. Every polygon is tested with ST_IsValid.
  2. Invalid ones are repaired with ST_MakeValid and reduced to the right geometry type.
  3. The number repaired is stored on the import run (for the Lamu data, 1,425), and each record notes whether it was repaired.
  4. The original geometry is retained in the source record.

Effect. Repairs usually change a polygon by a sliver. In rare cases a repaired shape splits into several parts, which Atlas stores as a multipart polygon.

Check yourself. The Data Quality page shows repaired counts per dataset. A high count signals a source that needs attention.

Limits. Repair can slightly alter very complex shapes.

Related reading

Guest preview · 139s left Explore until the timer ends. Then you’ll be asked to log in or create an account (about two minutes) to keep going.
Ask Atlas