Natural Earth country and territory geometries.
Interactive geographic field note · 2026
Density is
not destiny.
A reproducible map-led investigation into how population density and estimated GDP per person line up across countries — and where the picture refuses to be simple.
Maps can reveal a pattern.
They cannot explain it alone.
The starting point
Does a denser country tend to be richer?
We compare two imperfect but useful country-level measures: estimated population density and estimated GDP per person. The goal is not to crown a winner, but to practice a complete spatial workflow: define the question, make the calculations visible, inspect the geography, and leave room for what the data cannot tell us.
Country or territory polygon
Population ÷ equal-area km²
Log GDP/person ~ log density
Records with positive, usable values for both logs.
Descriptive association, not a causal estimate.
Most variation remains outside this one-variable model.
The geographic view
Two lenses.
One world.
The maps are intentionally exploratory. Hover a country for the source attributes, zoom into a region, and switch between the economic and demographic lenses.
A log color scale keeps the high end from washing out the rest of the map. All 177 records pass the corrected positive-value checks; the map still keeps the source estimates visible on hover.
Open map full screen ↗Beyond the choropleth
Where does wealth cluster?
Global Moran’s I tests whether neighboring countries have more similar log GDP per person than we would expect by chance. Local Moran’s I then labels significant high–high and low–low clusters, plus spatial outliers.
Positive spatial autocorrelation.
999 random permutations.
Significant at p < 0.05.
Significant at p < 0.05.
Coral marks High–High clusters, blue marks Low–Low clusters, gold and violet mark spatial outliers, and grey marks non-significant results. The map is a prompt for follow-up research, not a causal claim.
Open cluster map full screen ↗Trace the calculation
A map is only as trustworthy as the steps behind it.
Every derived field in the notebook has a reason. Here is the workflow in plain language.
Load a real source
Natural Earth’s 1:110m Admin 0 country polygons provide published estimates of population and GDP. The GeoJSON is downloaded at runtime and cached under data/.
Validate before calculating
We check required columns, missing geometries, duplicate names, invalid shapes, and non-positive values. Invalid geometry is repaired explicitly; unusable values stay visible.
checks · qualityMeasure in the right CRS
Country area is calculated after projecting to EPSG:6933, a world equal-area CRS. Density is population divided by area in square kilometres — not degrees.
crs · derived variableModel with restraint
The log-log regression summarizes association: a 1% change in density corresponds to an estimated slope-percent change in GDP per person. It does not prove a mechanism.
ols · descriptiveWhat the model sees
The line is real.
It is not the whole story.
The fitted relationship is negative in this version of the source data, but the modest R² is the more important signal: density alone leaves a lot unexplained.

Read the slope as an association
In this specification, the slope is about −0.16. That is a compact summary of this dataset, not a policy prescription and not evidence that density causes lower income.

The honest conclusion
The map is evidence,
not a verdict.
Natural Earth attributes are estimates, country averages hide within-country variation, and generalized boundaries simplify small places. The analysis is cross-sectional and omits many plausible confounders — urbanization, institutions, geography, and measurement quality among them.
Estimates, not official current statistics. GDP and population are source attributes and may be dated.
Ecological comparison. A country-level pattern cannot be projected onto individuals or cities.
Boundaries matter. Disputed territories and generalized 1:110m polygons shape what the map can show.