GIS Data Processing and Cleaning

Check CRSs, coordinates, geometries, attributes, and duplicate features, and understand the roles of GDAL, PROJ, QGIS, and PostGIS.

🎯 Introduction

By the end of this article, you will be able to explain why raw GIS data cannot always be published directly and design a cleaning workflow from inspection to delivery.

🧹 Common Problems in Raw Data

GIS files may lack a coordinate reference system (CRS), use misunderstood coordinate units, contain self-intersecting Polygons or unclosed rings—the coordinate sequences forming Polygon boundaries—or include empty geometries, duplicate features, or inconsistent field units.

These issues can cause misaligned layers, incorrect areas, failed spatial queries, or duplicate counts. Being able to open a dataset only means its format is readable, not that it is suitable for analysis.

Data cleaning turns a readable file into data that can be reliably overlaid, queried, and used for statistics.

✅ Inspection Checklist

  1. Verify that a CRS is defined and determine whether layers need a common CRS.
  2. Check coordinate order, ranges, and units.
  3. Check that geometry types meet field and application requirements.
  4. Check Polygon ring closure, self-intersections, and empty geometries.
  5. Verify unique IDs and check for duplicate features.
  6. Standardize attribute fields, data types, units, and missing values.

🧰 The Roles of Four Tools

ToolMain role
GDALTools for reading, writing, converting, and batch-processing spatial files
PROJA library for interpreting CRSs and transforming coordinates and projections
QGISDesktop software for viewing, inspecting, editing, and validating spatial data
PostGISAn extension that lets PostgreSQL store spatial data and perform spatial queries

These tools do not replace one another. The frontend usually consumes cleaned service data rather than repairing every raw GIS file.

Assigning these roles puts each problem at the appropriate stage: GDAL handles file formats, PROJ handles coordinates, QGIS supports manual inspection, and PostGIS handles online queries.

🔁 From Raw Files to Usable Layers

Preserve the original files → read metadata → check CRS and extent → repair or flag geometry problems → standardize fields and units → convert to the publishing format → spot-check map locations and statistics → record the data version.

Keep originals and processing records during repairs. Do not overwrite source coordinates just to make the map display, or automatically guess a familiar CRS when the actual CRS is unknown.

🧾 Summary

  • Readable data is not necessarily correct data.
  • Check the CRS, coordinates, geometries, and attributes.
  • GDAL, PROJ, QGIS, and PostGIS have different roles.
  • Cleaning workflows must preserve originals, processing records, and published versions.

❓ Knowledge Check

Q1: Is backend validation still needed after frontend validation passes?

Yes. Data can enter the system without going through the frontend, and complex geometries are usually checked with server-side tools.

Q2: Do plausible coordinate ranges prove the CRS is correct?

No. Several CRSs can have similar numeric ranges. Verify the source.

🧪 Exercise

Design import report fields for a Polygon file. Include at least a record ID, error type, processing status, and processing notes.

// Write your code here

🎉 You now know how raw GIS files become usable layers!