Skip to main content

Module density

Module density 

Source
Expand description

Population density for density-weighted simplification (GHS-POP R2023A).

The source is the European Commission Joint Research Centre’s Global Human Settlement Layer population grid, © European Union 1995–2023 (CC BY 4.0; Schiavina, Freire, Carioli, MacManus 2023, https://doi.org/10.2905/2FF68A52-5B5B-4A22-8F40-C41DA8332CFE). It is a single global GeoTIFF in WGS84 at 30 arc-seconds (~1 km), storing the population count per cell, as a free direct download. The one-time build fetches the ~460 MB zip through the crate::download cache, stream-decodes the tif tile by tile while summing 8×8 blocks into a 4-arc-minute grid, converts counts to people/km², and caches the result as a small flat sidecar (~58 MB). Steady-state builds read only the sidecar.

The resolution rationale is that weighting only needs order-of-magnitude density near a boundary: 4′ (~7.4 km) cells are far below any useful epsilon ceiling while keeping the grid cheap to hold in memory.

Structs§

DensityGrid
Population density (people/km²) on a coarse global lon/lat grid. Row 0 is the northernmost; dlat is positive.

Constants§

GHS_POP_URL
The URL the GHS-POP population raster downloads from (JRC open data).

Functions§

sidecar_path
Returns the path of the decoded density sidecar inside cache_dir, which lets callers fingerprint the density data without loading it (the webdist blob cache).