Skip to content

pycensus.census.countries.eu.census_grid.loader

Loader for the Eurostat Census 2021 population grid (1 km x 1 km, EU-wide).

Technical aspects

Source: https://gisco-services.ec.europa.eu/census/2021/Eurostat_Census-GRID_2021_V3.zip (566 MB, final version based on data received 22/01/2025, published 2026-06-19; checked live 2026-11-17). The zip holds the same table as CSV, GeoPackage, GeoTIFF and a 76 MB Parquet; this loader extracts only the Parquet.

Coverage: the EU-27 plus Switzerland, Liechtenstein and Norway; 4,595,932 cells (populated and unpopulated) plus one <CC>_unallocated row per country that could not place part of its population on the grid (FR, IT, FI, BG, EL, SE, DK, NO, BE, LV, LU, SI...).

Columns (EU regulation 1799/2018): T total population, M/F sex, Y_LT15/Y_1564/Y_GE65 age, EMP employed persons, NAT/EU_OTH/OTH place of birth, SAME/CHG_IN/CHG_OUT residence one year before, LAND_SURFACE (km2), POPULATED, CNTR_ID (countries reporting the cell, e.g. AT-CH-LI for border cells). -8888 = confidential, -9999 = not available: both are read as missing (NaN), never as 0.

Verification (2026-11-17), sum of T over the cells of one country: Spain 47.371 M (INE Census 2021: 47.385 M), Italy 58.985 M + 0.096 M unallocated (ISTAT Census 2021: 59.03 M). Germany sums 81.6 M (official 83.2 M): German cells carry disclosure control (rounding / suppression of sparse cells), as in the Zensus grids. By-category columns need not add up to T for the same reason (documented in the file's read.me).

Geometry: GRD_ID = CRS3035RES1000mN<northing>E<easting>, the south-west corner of the cell in ETRS89-LAEA (EPSG:3035). Cells are built as 1 km squares there and returned in EPSG:4326.

Resolution class: high -- every cell is at most 1 km2, so no unit with more than 5,000 residents exceeds 1 km2 (:mod:pycensus.resolution).

table_path(data_dir=None)

Local path of the grid Parquet (downloads the zip and extracts the Parquet on first use).

Parameters:

Name Type Description Default
data_dir Optional[str]

Root of the raw cache (default: the shared pycensus cache, data/eu).

None

Returns:

Type Description
Path

Path of ESTAT_Census_2021_V3.parquet.

load(aoi=None, countries=None, populated_only=True, data_dir=None)

1 km grid cells of the Census 2021 grid.

Parameters:

Name Type Description Default
aoi

GeoDataFrame / GeoSeries of the area of interest; cells intersecting it are returned.

None
countries Union[None, str, Iterable[str]]

Eurostat or ISO2 code(s): only cells reported by these countries (border cells reported by several countries are kept for each of them).

None
populated_only bool

drop cells with no population (T == 0 and POPULATED == 0).

True
data_dir Optional[str]

Root of the raw cache.

None

Returns:

Name Type Description
GeoDataFrame

GeoDataFrame with GEOID (GRD_ID), countries (CNTR_ID), the :data:COLUMNS features,

GeoDataFrame

foreignBornPopulation, populated and geometry (1 km square, EPSG:4326). The unallocated rows are not

included GeoDataFrame

see :func:unallocated.

unallocated(data_dir=None)

Population each country could not place on the grid (one row per country, GEOID <CC>_unallocated).

Parameters:

Name Type Description Default
data_dir Optional[str]

Root of the raw cache.

None

Returns:

Type Description
DataFrame

DataFrame with GEOID, country and the feature columns (no geometry).