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. 40 guides in total.
9 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
- Discrete Global Grids Explained: H3, S2, Geohash and Why Cells Beat Coordinates discrete global grid system explained
- H3 Explained: How a Hexagonal Grid Indexes the Whole Earth h3 hexagon index explained
- Choosing an H3 Resolution: Cell Size, Counts and What Each Level Can Show h3 resolution cell size
- Margins of Error Explained: Why Survey Estimates Need Their Uncertainty acs margin of error explained
- Small Numbers Explained: Why Rates in Small Areas Jump Around small area rate instability
- Gravity and Huff Models Explained: Predicting Where People Go huff model explained
- Re-identification risk in spatial data explained re-identification spatial data
- Spatial k-anonymity explained spatial k-anonymity
- Management zones explained management zones precision agriculture
⚙️ 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
- How to Calculate a Climatology and Anomalies with xarray climate anomaly xarray
- How to Take an Area-Weighted Mean over a Latitude–Longitude Grid area weighted mean xarray latitude
- How to Aggregate Points into H3 Hexagons and Map Them aggregate points h3 hexagons
- How to Use H3 Neighbours for k-Ring Smoothing and Buffers h3 grid_disk k ring python
- How to Aggregate Survey Estimates and Their Margins of Error aggregate acs margin of error python
- How to Smooth Unstable Area Rates with Empirical Bayes in Python empirical bayes rate smoothing python
- How to Estimate Market Share with a Huff Model in Python huff model python
- How to measure re-identification risk in a point dataset measure re-identification risk python
- How to build management zones with clustering in Python management zones clustering python
- How to analyse an on-farm strip trial in Python on farm strip trial analysis
🔧 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
- Fixing an H3 Map That Misleads: Unequal Cell Areas and Empty Cells h3 cell area distortion
- Fixing a Rate Map Dominated by Tiny, Nearly Empty Areas choropleth rate map small population
- Fixing a Gravity Model That Sends Everyone to the Biggest Store huff model distance decay parameter
- Geomasking changed the result of the analysis geomasking bias analysis
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 → -
Spatial Machine Learning
Why the usual rules break, and what to do instead.
Open path → -
Interpolation & Surfaces
A continuous surface from scattered samples, with its support attached.
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 → -
Geoprivacy & Anonymisation
A coordinate is an identifier. Release it as if it were one.
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.