pycensus.cadaster.countries.spain.catastro.loader¶
Spanish Catastro INSPIRE Buildings: per-municipality ATOM downloads (building + buildingpart GML), no API key.
from pycensus.cadaster.countries.spain.catastro import load
b = load(aoi, cache_dir) # unified cadaster schema (pycensus.cadaster)
The municipality index (INE code, name, zip URL, GeoRSS bounding polygon) is read once from the 52 territorial-office feeds and cached;
the municipalities whose polygon touches the AOI are downloaded (zips kept under
municipality_index(cache_dir=None, refresh=False)
¶
code, name, url, geometry (shapely, EPSG:4326) of every municipality of the common-regime cadaster.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
cache_dir
|
Cache folder; |
None
|
|
refresh
|
bool
|
Download the index again. |
False
|
Returns:
| Type | Description |
|---|---|
DataFrame
|
DataFrame of municipalities. |
load(aoi, cache_dir=None, workers=8)
¶
Spanish common-regime cadaster buildings (INSPIRE) of every municipality touching aoi.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
aoi
|
GeoDataFrame
|
Area of interest (GeoDataFrame). |
required |
cache_dir
|
Cache folder; |
None
|
|
workers
|
int
|
Parallel downloads. |
8
|
Returns:
| Type | Description |
|---|---|
GeoDataFrame
|
The buildings. |
prefetch(cache_dir=None, workers=8, provinces=None)
¶
Download every municipality zip (or those of provinces, INE 2-digit codes) without parsing. Returns the number of zips.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
cache_dir
|
Cache folder; |
None
|
|
workers
|
int
|
Parallel downloads. |
8
|
provinces
|
INE 2-digit province codes; |
None
|