diff --git a/modules/burgs-and-states.js b/modules/burgs-and-states.js index 1fe0eceb..f4e0a94f 100644 --- a/modules/burgs-and-states.js +++ b/modules/burgs-and-states.js @@ -1026,13 +1026,17 @@ window.BurgsAndStates = (() => { states[s].cells += 1; states[s].area += cells.area[i]; if (cells.burg[i]) { - // Burg represents ALL population for this cell (stored in thousands) - states[s].urban += pack.burgs[cells.burg[i]].population; + const burgPopulation = pack.burgs[cells.burg[i]].population; + if (burgPopulation > 0.1) { + // Large burg (>100 people) = urban population + states[s].urban += burgPopulation; + } else { + // Small burg (≤100 people) = rural population + states[s].rural += burgPopulation; + } states[s].burgs++; - } else { - // Only count cells.pop for unsettled areas (no burg present) - states[s].rural += cells.pop[i]; } + // Cells without burgs have no population (rural population is housed in small burgs) } // convert neighbors Set object into array diff --git a/modules/dynamic/overview/charts-overview.js b/modules/dynamic/overview/charts-overview.js index 171778a4..e6cc59de 100644 --- a/modules/dynamic/overview/charts-overview.js +++ b/modules/dynamic/overview/charts-overview.js @@ -672,7 +672,14 @@ function getUrbanPopulation(cellId) { } function getRuralPopulation(cellId) { - return pack.cells.pop[cellId] * populationRate; + const burgId = pack.cells.burg[cellId]; + if (!burgId) return 0; // No burg = no rural population + + const burgPopulation = pack.burgs[burgId].population; + if (burgPopulation > 0.1) return 0; // Burg has >100 people = no rural population + + // Small burg (≤100 people) = count the burg's actual population as rural + return burgPopulation * 1000 * populationRate; } function sortData(data, sorting) {