pycensus.census.countries.euskadi.eustat.loader¶
Loader for Euskadi municipal population, returning a common-schema GeoDataFrame.
Technical aspects
Similar to usa.acs.loader, mexico.inegi.loader, and spain.eustat.loader, this module provides a load() function that: 1. Resolves the requested geographic level 2. Determines which territories to load (from AOI or explicit list) 3. Uses the cache system to load only missing columns 4. Fetches boundaries and attribute data as needed 5. Returns a GeoDataFrame with GEOID, geometry, and eustat_prefixed columns
Unlike usa's Census Bureau API, neither of Euskadi's own real data
portals (opendata.euskadi.eus, eustat.eus) is reachable over a
plain scripted HTTP request -- both returned 403/404 to real curl
checks made during this rebuild (see euskadi/geography.py's
docstring for the exact checks). This loader therefore sources both
geometry and its one real attribute column (population, via
euskadi.eustat.schema.SCHEMA) from Eurostat/GISCO's LAU 2021
GeoPackage, which republishes real INE-sourced Spanish municipal
boundaries and population -- verified against Gipuzkoa's, Araba's, and
Bizkaia's well-documented real populations (see schema.json).
No API key is required for this source.
Source
Eurostat/GISCO LAU 2021: https://gisco-services.ec.europa.eu/distribution/v2/lau/lau-2021-files.html
load(aoi=None, regions=None, level='municipality', year='latest', api_key=None, cache_dir=None, cache=True, data_dir=None)
¶
Load Euskadi municipal population data as a common-schema GeoDataFrame.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
aoi
|
Optional[GeoDataFrame]
|
Area of interest. Used to auto-detect |
None
|
regions
|
Optional[Union[str, List[str]]]
|
Territory name(s)/abbreviation(s)/code(s) to load (Araba,
Bizkaia, Gipuzkoa or 01, 48, 20). Derived from |
None
|
level
|
str
|
Standard geometry level name. Real levels implemented here
are |
'municipality'
|
year
|
Union[int, str]
|
Vintage year, or |
'latest'
|
api_key
|
Optional[str]
|
Unused -- no API key is required for this source. |
None
|
cache_dir
|
Optional[str]
|
Root of pyCensus' parquet cache. |
None
|
cache
|
bool
|
If |
True
|
data_dir
|
Optional[str]
|
Unused (kept for interface compatibility). |
None
|
Returns:
| Type | Description |
|---|---|
GeoDataFrame
|
GeoDataFrame with |
GeoDataFrame
|
column per logical column in :data: |
Raises:
| Type | Description |
|---|---|
ValueError
|
If neither |