pycensus.census.countries.andorra.geography¶
Boundary fetching shared by every Andorra census source.
Technical aspects
Real boundaries come from the Departament d'Estadistica's own hosted
ArcGIS Server layer Parroquies_Pol_codi
(:data:pycensus.andorra.api.PARISH_BOUNDARY_URL), fetched live and
verified 2026-08-20: querying it returns exactly 7 polygon features,
whose Nom/Codi fields match Andorra's 7 real parishes and their
ISO 3166-2:AD codes one-for-one (see
:data:pycensus.andorra.constants.PARISH_CODES), and whose combined
longitude/latitude bounds (1.409-1.787 E, 42.429-42.656 N, requested
reprojected to EPSG:4326 via outSR=4326) land exactly on Andorra's
known geographic extent.
Only parish boundaries are fetched directly. nation is built by
dissolving all 7 parish polygons.
No finer subdivision (quart/veïnat -- see
https://en.wikipedia.org/wiki/Parishes_of_Andorra) has a real, verified
boundary source: the same ArcGIS Server only exposes country/parish/
village-point layers (see :mod:pycensus.andorra.api module docstring
for the full layer listing under Estadistica/Cartografia_base).
Requesting anything other than parish/nation raises
NotImplementedError rather than fabricating placeholder geometry.
load_boundaries(level, region=None, year=2026, erase_water=None)
¶
Fetch real boundaries for one Andorra geography level.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
level
|
str
|
Standard geometry level name, resolved through
:data: |
required |
region
|
Optional[str]
|
A parish name or ISO 3166-2:AD code (see
:func: |
None
|
year
|
int
|
Accepted for interface parity; the source has no vintage dimension (current parish boundaries). |
2026
|
erase_water
|
Optional[bool]
|
Accepted for interface parity, not implemented. |
None
|
Returns:
| Type | Description |
|---|---|
GeoDataFrame
|
GeoDataFrame with a |
GeoDataFrame
|
|
Raises:
| Type | Description |
|---|---|
NotImplementedError
|
If |
load_boundaries_multi(level, regions=None, year=2026, erase_water=None, aoi=None)
¶
Fetch and concatenate boundaries across one or more regions, optionally clipped to an AOI.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
level
|
str
|
Standard geometry level name. |
required |
regions
|
Optional[Union[str, List[str]]]
|
Region code(s). If |
None
|
year
|
int
|
Accepted for interface parity. |
2026
|
erase_water
|
Optional[bool]
|
Accepted for interface parity, not implemented. |
None
|
aoi
|
Optional[GeoDataFrame]
|
If given, the result is filtered to geometries intersecting it. |
None
|
Returns:
| Type | Description |
|---|---|
GeoDataFrame
|
GeoDataFrame with a |
parishes_in_aoi(aoi, year=2026)
¶
Return the ISO 3166-2:AD codes of every parish intersecting aoi.
Andorra is tiny enough (7 parishes total, one 7-row request) that no
bounding-box pre-filter is needed before fetching real geometry --
unlike larger countries' states_in_aoi helpers.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
aoi
|
GeoDataFrame
|
Area of interest (GeoDataFrame). |
required |
year
|
int
|
Boundary year. |
2026
|
Returns:
| Type | Description |
|---|---|
List[str]
|
Parish codes. |
states_in_aoi(aoi, year=2026)
¶
Alias of :func:parishes_in_aoi, kept for interface parity with other countries.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
aoi
|
GeoDataFrame
|
Area of interest (GeoDataFrame). |
required |
year
|
int
|
Boundary year. |
2026
|
Returns:
| Type | Description |
|---|---|
List[str]
|
Parish codes. |