Data cleaning
Turning a messy download into an analysis-ready dataset you can trust.
Everything on Spatial Workflow about data cleaning, in the order that usually works: understand the idea, then run the task, then fix it when it goes wrong. 37 guides in total.
3 learning paths run through this topic — follow one if you would rather work through a route than pick a single guide.
🧭 Start with the concepts
The ideas the how-to guides below assume you already have.
- Spatial Data Quality: The Six Dimensions That Matter spatial data quality dimensions
- Null, Empty, Missing and Invalid: Four Kinds of Broken Geometry empty geometry geopandas
- Topological Coverage: What "Clean" Means for Adjacent Polygons polygon coverage gaps overlaps
- Repair, Reject or Flag? Choosing What Cleaning Should Do gis data cleaning decisions
- Choropleth Classification Explained: Quantiles, Equal Interval and Natural Breaks choropleth classification schemes
- Test Fixtures for GIS Code: Building Spatial Test Data You Can Trust gis test fixtures python
- Spatial Join Cardinality Explained: One-to-One, One-to-Many and What to Do spatial join one to many
- Attribute Join or Spatial Join? Choosing How to Combine Two Layers attribute join vs spatial join
⚙️ Then do the task
Step-by-step walkthroughs with code you can copy and adapt.
- How to Remove Null and Empty Geometries in GeoPandas remove null geometries geopandas
- The Python GIS Data Cleaning Checklist: From Raw Download to Analysis-Ready gis data cleaning python
- How to Find and Remove Duplicate Geometries in GeoPandas remove duplicate geometries geopandas
- How to Clean Messy CSV Coordinates into a Reliable GeoDataFrame clean csv coordinates
- How to Standardise and Repair CRS Across a Folder of Files in Python standardise crs across files python
- How to Clean and Normalise Attribute Columns in a GeoDataFrame clean attribute columns geodataframe
- How to Handle Missing and Null Values in Spatial Datasets in Python handle missing values spatial data python
- How to Snap and Align Geometries to Fix Slivers and Gaps in Python snap geometries fix slivers python
- How to Validate a GeoDataFrame Against a Schema Before Analysis validate geodataframe schema python
- How to Build a Repeatable Data-Cleaning Report in GeoPandas data cleaning report geopandas
- How to Split Multipart Geometries into Single Parts in GeoPandas explode multipart geometries geopandas
- How to Fuzzy-Match Place Names When Joining Spatial Data in Python fuzzy match place names python
- How to Find and Remove Spatial Outliers in a Point Dataset remove spatial outliers python
- How to Clean and Standardise Date Columns in Spatial Data clean date columns spatial data python
- How to Explore a Spatial Dataset You Have Never Seen Before explore spatial dataset python
- How to Find and Fix Gaps and Overlaps in a Polygon Coverage fix gaps overlaps polygons python
- How to Merge Near-Duplicate Features in a Spatial Dataset merge near duplicate features python
- How to Clean a Line Network: Dangles, Overshoots and Disconnects clean road network topology python
- How to Standardise Attribute Values Against a Controlled Vocabulary standardise attribute values python
- How to Set, Assign and Convert CRS in GeoPandas (set_crs vs to_crs) set_crs vs to_crs geopandas
- How to Reproject Between Datums Correctly (and Why the Grid File Matters) datum transformation python pyproj
🔧 When it breaks
The errors this topic produces, with the cause explained rather than just the command.
- How to Fix Invalid Geometries in Python (GeoPandas) invalid geometries geopandas
- Why Are My Shapefile Column Names Truncated? How to Fix It shapefile column names truncated
- buffer(0) Does Not Fix My Invalid Geometry: What to Do Instead buffer 0 not fixing geometry
- Garbled Attribute Text and UnicodeDecodeError from a Shapefile: How to Fix Encoding shapefile encoding error python
- GeoPandas to_file() Fails on a Column Type: How to Fix It geopandas to_file field type error
- Rasterio Returns the Wrong Values: NoData, Scaling and dtype Fixes rasterio nodata wrong values
- My Cleaned Layer Has More Rows Than the Original: How to Fix It geopandas more rows after cleaning
- My GeoPandas Choropleth Colours Look Wrong: How to Fix It geopandas choropleth colours wrong
Learning paths through this topic
A curated route rather than a list — the guides in the order that builds on itself.
Related topics
Subjects that keep coming up alongside this one, most overlap first.