=== versions === python 3.12.0 | exactextract 0.3.0 | rasterstats 0.21.0 | rasterio 1.5.2 (GDAL 3.12.2) | geopandas 1.2.0 === Step 1: LSOA 2021 boundaries for Cumbria (ONS Open Geography Portal) === 319 LSOAs, CRS EPSG:27700, total area 6,824 km2 LSOA area: median 1.40 km2, smallest 0.104 km2, largest 241 km2 district Allerdale 59 Barrow-in-Furness 48 Carlisle 71 Copeland 47 Eden 36 South Lakeland 58 Census 2021 usual residents in these LSOAs: 499,873 === Step 2: three rasters in three different CRSs === population ghs_pop_e2020_cumbria_54009.tif ESRI:54009 (Mollweide) pixel 100 m 1116 x 1201 float64 elevation cop_dem_glo30_cumbria.tif EPSG:4326 pixel 0.000416667 deg 3671 x 4218 float32 land cover esa_worldcover_2021_cumbria.tif EPSG:4326 pixel 8.33333e-05 deg 18355 x 14059 uint8 === Step 3: CRS alignment === rasterstats, BNG zones on the WGS84 DEM: MemoryError Unable to allocate 120. TiB exactextract, BNG zones on the WGS84 DEM: [0.0, 0.0, 0.0, 0.0, 0.0] | warning: Spatial reference system of input features does not exactly match raster. zones reprojected to each raster's CRS: OK GHSL total in the window: 755,462; after warping to BNG with nearest : 753,420 (-0.27%) GHSL total in the window: 755,462; after warping to BNG with bilinear: 757,731 (+0.30%) GHSL total in the window: 755,462; after warping to BNG with sum : 755,462 (-0.00%) === Step 4: population per LSOA, coverage-weighted vs centroid === method total vs census median |err| vs census exactextract (weighted) 509,188 +1.9% 6.2% rasterstats (centroid) 508,023 +1.6% 6.3% rasterstats all_touched 683,566 +36.7% 33.9% Census 2021 499,873 centroid vs coverage-weighted sum, by LSOA size: lsoas median_cells median_abs_diff_pct max_abs_diff_pct size_class < 0.5 km2 79 30.4 4.0 18.3 0.5-2 km2 98 88.1 2.2 12.4 2-10 km2 54 414.3 1.2 7.7 > 10 km2 88 5237.8 0.4 30.9 LSOAs where the two differ by more than 10%: 10 === Step 5: mean and maximum elevation (Copernicus DEM GLO-30) === mean elevation, exactextract minus rasterstats: median |diff| 0.02 m, max |diff| 0.29 m highest point: 974 m in Copeland 007F (E01019304); mean elevation range 6-489 m === Step 6: land-cover fractions (ESA WorldCover 2021) === share of Cumbria and exactextract-vs-rasterstats difference per LSOA (percentage points): class area_weighted_% median_abs_diff_pp max_abs_diff_pp Tree cover 13.83 0.01 0.19 Shrubland 0.00 0.00 0.00 Grassland 78.03 0.01 0.13 Cropland 4.67 0.00 0.06 Built-up 1.83 0.01 0.21 Bare / sparse 0.13 0.00 0.03 Water 1.31 0.00 0.10 Herbaceous wetland 0.20 0.00 0.02 Moss and lichen 0.00 0.00 0.00 fractions sum to 1 for every LSOA: True === Step 7: benchmark (best of 3 runs, all 319 LSOAs) === job raster_Mcells exactextract_s exactextract_raster_seq_s rasterstats_s speed-up population sum (100 m) 1.34 1.38 1.40 1.61 1.16 elevation mean (30 m) 15.48 1.82 2.08 3.49 1.92 land-cover fractions (10 m) 258.05 10.48 10.68 6.45 0.62 === Step 8: export to GeoPackage === [['lsoa21_zonal_stats' 'MultiPolygon']] 319 features, 15 fields, CRS EPSG:27700, 8.4 MB === figures === figure 1: Carlisle 011C 0.16 km2, weighted 1073, centroid 1091, census 1051 wrote 5 figures and output\cumbria_lsoa_zonal_stats.gpkg