pycensus.census.countries.germany.geography¶
Boundary fetching for Germany census, backed by real Eurostat/GISCO NUTS data.
Technical aspects
Boundaries come from Eurostat/GISCO's NUTS (Nomenclature of Territorial
Units for Statistics) geojson distribution -- a real, keyless, verified
source (see :data:pycensus.germany.constants.GISCO_NUTS_GEOJSON_URL).
Verified live 2026-08-19: NUTS level 0/1/3, filtered to
CNTR_CODE == "DE", returned exactly 1 nation / 16 state / 401
district feature -- the real, documented counts of Germany's
administrative divisions -- and Hamburg's real NUTS1 geometry (DE6) has
bounds matching Hamburg's real coordinates.
Levels map to NUTS levels as: nation -> LEVL_0, state -> LEVL_1,
district -> LEVL_3 (Germany's Kreise are NUTS3, not NUTS2).
municipality (Gemeinde) has no real boundary source wired up yet --
requesting it raises NotImplementedError rather than fabricating
placeholder geometry (see :data:IMPLEMENTED_LEVELS).
Downloaded NUTS geojson is cached on disk (one file per level) under
<data_dir>/raw/gisco_nuts/, independent of :mod:pycensus.cache's
parquet cache.
Source
https://ec.europa.eu/eurostat/web/gisco/geodata/reference-data/administrative-units-statistical-units/nuts
municipality_population(data_dir=None)
¶
Return {GEOID, LAU_NAME, POP_2021} for every German municipality.
Real GISCO LAU population (see :data:GISCO_LAU_GEOJSON_URL), used by
:mod:pycensus.census.countries.germany.destatis.loader for the
municipality level -- unlike nation/state/district, this does not
require a GENESIS-Online account since GISCO already publishes the
population figure alongside the boundary.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data_dir
|
Optional[str]
|
Folder of the raw downloads; |
None
|
load_boundaries(level, region=None, year=2021, erase_water=None, data_dir=None)
¶
Fetch real GISCO NUTS boundaries for one Germany geography level.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
level
|
str
|
Standard geometry level name, resolved through
:data: |
required |
region
|
Optional[str]
|
A state name/abbreviation/code. If given for |
None
|
year
|
int
|
Vintage year. Kept for interface parity; GISCO NUTS 2021 is the only vintage wired up. |
2021
|
erase_water
|
Optional[bool]
|
Whether to clip inland water bodies. Defaults to
:data: |
None
|
data_dir
|
Optional[str]
|
Root directory for the raw GISCO cache. Defaults to
:data: |
None
|
Returns:
| Type | Description |
|---|---|
GeoDataFrame
|
GeoDataFrame with a |
Raises:
| Type | Description |
|---|---|
ValueError
|
If |
district_names(data_dir=None)
¶
Return {NUTS3 GEOID: NUTS_NAME} for every German district.
Real GISCO NUTS_NAME property (see :func:_load_germany_nuts),
used by :mod:pycensus.census.countries.germany.destatis.crosswalk to build a
real, name-matched AGS-to-NUTS3 crosswalk -- do not guess this mapping
arithmetically (see that module's docstring for why).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data_dir
|
Optional[str]
|
Folder of the raw downloads; |
None
|
states_in_aoi(aoi, year=2021, data_dir=None)
¶
Return the 2-letter state codes of every German state intersecting aoi.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
aoi
|
GeoDataFrame
|
Area of interest (GeoDataFrame). |
required |
year
|
int
|
Boundary year. |
2021
|
data_dir
|
Optional[str]
|
Folder of the raw downloads; |
None
|
Returns:
| Type | Description |
|---|---|
List[str]
|
State codes. |