Geometry & topology
Clipping, buffering, dissolving and overlays — and what makes a geometry valid.
Everything on Spatial Workflow about geometry & topology, in the order that usually works: understand the idea, then run the task, then fix it when it goes wrong. 72 guides in total.
17 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.
- Overlay Operations in GeoPandas: Union, Intersection, Difference Explained geopandas overlay operations
- Shapely Basics: Working with Geometry Objects in Python shapely python geometry
- What Makes a Geometry Valid? The OGC Rules Explained valid geometry rules gis
- WKT, WKB and GeoJSON: How Geometry Is Actually Stored wkt wkb geojson difference
- Topology in GIS Explained: Slivers, Gaps and Shared Boundaries gis topology explained
- Coordinate Precision and Floating Point in GIS Explained coordinate precision gis floating point
- Spatial Predicates Explained: Intersects, Within, Contains and the Rest spatial predicates geopandas
- 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
- Why GeoPandas Is Slow: The Four Real Bottlenecks why is geopandas slow
- Projected vs Geographic CRS: What Actually Changes When You Reproject projected vs geographic crs
- Street Networks as Graphs Explained street network graph explained
- Generalisation for Zoom Levels Explained zoom generalisation explained
- Map Scale Explained: How Much Detail a Scale Can Hold map scale detail
- H3 Hierarchy Explained: Parents, Children and Why They Do Not Nest Exactly h3 parent child hierarchy
- Catchment Areas Explained: Buffers, Isochrones and Voronoi Compared catchment area gis
- Geomasking methods explained: donut, random and adaptive geomasking methods
- 3D spatial data models explained: 2.5D, meshes and solids 3d spatial data models
- The coastline paradox explained for GIS work coastline paradox gis
- Maritime boundaries explained: EEZ, territorial sea and baselines eez territorial sea explained
⚙️ Then do the task
Step-by-step walkthroughs with code you can copy and adapt.
- How to Filter Spatial Data in Python Using GeoPandas filter geopandas data
- How to Clip Spatial Data in Python with GeoPandas clip shapefile python geopandas
- How to Dissolve Polygons in Python (GeoPandas) dissolve polygons geopandas
- How to Calculate Area and Distance in GeoPandas (Correctly) calculate area geopandas
- How to Create Buffers in GeoPandas for Spatial Analysis buffer analysis geopandas
- How to Get Polygon Centroids in GeoPandas polygon centroid geopandas
- How to Count Points in Polygons with GeoPandas count points in polygon geopandas
- How to Simplify Geometry in Python with GeoPandas and Shapely simplify geometry geopandas
- How to Create a Fishnet Grid in Python with GeoPandas fishnet grid python geopandas
- How to Convert a Raster to a Vector in Python raster to vector python
- How to Convert Points to Lines in GeoPandas points to line geopandas
- How to Aggregate Spatial Data by Region in GeoPandas aggregate spatial data geopandas
- How to Remove Null and Empty Geometries in GeoPandas remove null geometries geopandas
- How to Find and Remove Duplicate Geometries in GeoPandas remove duplicate geometries geopandas
- How to Snap and Align Geometries to Fix Slivers and Gaps in Python snap geometries fix slivers python
- How to Batch Clip Many Layers to a Single Boundary in Python batch clip shapefiles boundary python geopandas
- How to Split Multipart Geometries into Single Parts in GeoPandas explode multipart geometries geopandas
- How to Find and Fix Gaps and Overlaps in a Polygon Coverage fix gaps overlaps polygons python
- How to Clean a Line Network: Dangles, Overshoots and Disconnects clean road network topology python
- How to Clip a Raster to a Polygon in Python clip raster to polygon python
- How to Rasterize a Vector Layer in Python rasterize vector python
- How to Add Legends, Labels and a Scale Bar to a GeoPandas Map geopandas map legend labels
- How to Plot Multiple Layers on One Map in GeoPandas plot multiple layers geopandas
- How to Assert on Geometry in pytest Without Flaky Comparisons pytest assert geometry equal
- How to Replace a Row Loop with Vectorised GeoPandas Operations vectorise geopandas loop
- How to Choose the Right Projected CRS for Your Study Area choose projected crs python
- How to Measure Distance Accurately in Python: Geodesic vs Projected measure distance accurately python
- How to Calculate the Shortest Path Along a Street Network shortest path street network python
- How to Clip a NetCDF Grid to a Polygon in Python clip netcdf shapefile python
- How to Fill a Polygon with H3 Cells h3 polygon to cells python
- How to Turn H3 Cells into a GeoDataFrame of Polygons h3 cells to polygons geopandas
- How to Calculate Population-Weighted Centroids population weighted centroid python
- How to Build Voronoi Service Areas Around Facilities in Python voronoi polygons python geopandas
- How to Extract a Stream Network from a DEM extract streams from dem python
- How to apply donut geomasking to sensitive points in Python donut geomasking python
- How to extrude building footprints into 3D in Python extrude building footprints python
- How to calculate building volumes and floor area in Python building volume python
- How to clip a dataset to an exclusive economic zone clip to eez python
🔧 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
- Shapely TopologyException: Found Non-Noded Intersection (How to Fix) shapely topologyexception
- GeoPandas "No Geometry Column" Error: How to Fix It geopandas no geometry column
- buffer(0) Does Not Fix My Invalid Geometry: What to Do Instead buffer 0 not fixing geometry
- Mixed Geometry Types Error When Saving a GeoDataFrame: How to Fix It mixed geometry types geopandas
- My Cleaned Layer Has More Rows Than the Original: How to Fix It geopandas more rows after cleaning
- GeoPandas .apply() Takes Hours: How to Fix It geopandas apply slow
- Contours Come Out Jagged or Full of Tiny Rings contours jagged noisy
- NetworkX Says No Path Exists Between Two Nodes networkx no path exists
- Fixing H3 Polygon Fill That Misses Cells or Returns Nothing h3 polygon_to_cells empty
- Fixing Voronoi Polygons That Extend Forever or Miss the Study Area voronoi polygons infinite python
- Geomasked points land in the sea or outside the study area geomasked points in water
- A building mesh is not watertight and its volume is wrong mesh not watertight volume
- Delineated field boundaries merge fields or swallow roads field delineation merges fields
Learning paths through this topic
A curated route rather than a list — the guides in the order that builds on itself.
-
Terrain & Elevation
Turn a grid of heights into slope, shade, contours and drainage.
Open path → -
Networks & Routing
Distance along the street, not across the rooftops.
Open path → -
Raster Analysis
Read, reproject, clip and summarise raster data in Python.
Open path → -
Making Maps
Turn a GeoDataFrame into a map someone else can read.
Open path → -
GIS Data Cleaning
Turn messy spatial data into analysis-ready datasets.
Open path → -
Batch Processing
Process many files at once, reliably.
Open path → -
Publishing Web Maps
Get the data into a browser without shipping the whole dataset.
Open path → -
Cartography & Map Design
The map is correct. Now make it readable.
Open path → -
Gridded & Climate Data
A raster with a time axis, a calendar and forty years in one file.
Open path → -
H3 & Global Grids
Give every point a cell id and half the geometry work becomes a join.
Open path → -
Census & Demographics
The most-used open data there is, and the easiest to map wrongly.
Open path → -
Location & Accessibility
Who can reach what — and where the next site should go.
Open path → -
Hydrology & Watersheds
A DEM already knows where the water goes. Ask it carefully.
Open path → -
Geoprivacy & Anonymisation
A coordinate is an identifier. Release it as if it were one.
Open path → -
3D & Buildings
A footprint plus a height is not a building, but it is most of one.
Open path → -
Coastal & Marine
The shoreline is a choice of datum, not a line on a map.
Open path → -
Agriculture & Crops
One field, one season, and a dozen ways to measure it wrong.
Open path →
Related topics
Subjects that keep coming up alongside this one, most overlap first.