Spatial statistics
Density, clustering, hotspots and autocorrelation — measuring pattern rather than drawing it.
Everything on Spatial Workflow about spatial statistics, in the order that usually works: understand the idea, then run the task, then fix it when it goes wrong. 17 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.
- The Modifiable Areal Unit Problem Explained modifiable areal unit problem
- Kernel Density Explained: What a Heatmap Actually Shows kernel density explained
- Spatial Clustering Explained: DBSCAN, K-Means and What They Assume spatial clustering explained
- Spatial Autocorrelation Explained spatial autocorrelation explained
- The Variogram Explained: How Far Does a Measurement Reach variogram explained
⚙️ Then do the task
Step-by-step walkthroughs with code you can copy and adapt.
- How to Make a Point Density Heatmap in Python point density heatmap python
- 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 Build a Distance Matrix Between Two Layers in Python distance matrix geopandas
- How to Calculate Moran's I in Python morans i python
- How to Find Hotspots with Getis-Ord Gi* in Python getis ord hotspot python
- How to Build Spatial Features for a Machine Learning Model build spatial features python
- How to Fit a Variogram and Krige a Surface in Python kriging python
🔧 When it breaks
The errors this topic produces, with the cause explained rather than just the command.
- Your Heatmap Looks Wrong: KDE Bandwidth and Cell Size kde bandwidth wrong
- 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
- My Kriging Fit Fails or Returns a Flat Surface kriging fit fails flat surface
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.