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. 33 guides in total.
8 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
- Spatial Clustering Explained: DBSCAN, K-Means and What They Assume spatial clustering explained
- Network Distance vs Straight-Line Distance Explained network distance vs straight line
⚙️ 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
- How to Bin Points into Hexagons in Python hexbin points python
- How to Cluster Points by Location with DBSCAN in Python dbscan spatial clustering python
- How to Calculate Moran's I in Python morans i python
- How to Snap Points to a Street Network in Python snap points to network python
- How to Aggregate Movement into Flows Between Zones aggregate movement flows python
- How to Interpolate to Polygons Instead of a Grid areal interpolation python
🔧 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
- DBSCAN Returns One Giant Cluster or Labels Everything Noise dbscan one cluster
- Spatial Weights Warn About Islands or Moran's I Returns nan spatial weights islands warning
Learning paths through this topic
A curated route rather than a list — the guides in the order that builds on itself.
-
Spatial Statistics
Measure the pattern instead of eyeballing the map.
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 → -
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 → -
Movement & Time
Tracks are not points — the order and the clock are the data.
Open path → -
Interpolation & Surfaces
A continuous surface from scattered samples, with its support attached.
Open path →
Related topics
Subjects that keep coming up alongside this one, most overlap first.