Joins & relationships
Spatial joins, attribute joins, nearest neighbour and point-in-polygon.
Everything on Spatial Workflow about joins & relationships, in the order that usually works: understand the idea, then run the task, then fix it when it goes wrong. 23 guides in total.
4 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 Indexes Explained: R-trees and Why Spatial Joins Are Fast spatial index r-tree explained
- Spatial Predicates Explained: Intersects, Within, Contains and the Rest spatial predicates geopandas
- Spatial Join Cardinality Explained: One-to-One, One-to-Many and What to Do spatial join one to many
- Nearest-Neighbour Joins Explained: Distance, Ties and Search Radius nearest neighbour join explained
- 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 Filter Spatial Data in Python Using GeoPandas filter geopandas data
- How to Join Attribute Data to a GeoDataFrame in Python join attribute data geopandas
- How to Count Points in Polygons with GeoPandas count points in polygon geopandas
- How to Find the Nearest Point in GeoPandas nearest point geopandas
- How to Aggregate Spatial Data by Region in GeoPandas aggregate spatial data geopandas
- How to Select Features by Location in GeoPandas select by location geopandas
- How to Perform a Spatial Join in Python (GeoPandas) spatial join geopandas
- How to Fuzzy-Match Place Names When Joining Spatial Data in Python fuzzy match place names python
- How to Run Spatial SQL Queries from Python with PostGIS spatial sql query python postgis
- How to Merge Near-Duplicate Features in a Spatial Dataset merge near duplicate features python
- How to Enrich Many Files Against One Reference Layer batch spatial join reference layer
- How to Calculate Zonal Statistics in Python zonal statistics python
- How to Do a Spatial Join in PostGIS with SQL postgis spatial join sql
- How to Use the Spatial Index Directly in GeoPandas (sindex) geopandas sindex spatial index
🔧 When it breaks
The errors this topic produces, with the cause explained rather than just the command.
- Spatial Join Returns Empty Results in GeoPandas: How to Fix It spatial join empty geopandas
- GeoPandas Merge Returns NaN or No Matches: How to Fix It geopandas merge no matches
- GeoPandas "Columns Overlap but No Suffix Specified" Error: How to Fix It columns overlap but no suffix specified
- GeoPandas Spatial Join Returns Duplicate Rows: How to Fix It geopandas spatial join duplicates
Learning paths through this topic
A curated route rather than a list — the guides in the order that builds on itself.
-
Raster Analysis
Read, reproject, clip and summarise raster data in Python.
Open path → -
Spatial SQL & PostGIS
Move the heavy lifting from Python into the database.
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 →
Related topics
Subjects that keep coming up alongside this one, most overlap first.