pycensus.census.countries.chile.ine.loader¶
Loader for INE Chile Censo 2017 (via the Esri Chile DPA FeatureServer), returning a common-schema GeoDataFrame.
Technical aspects
Mirrors :mod:pycensus.mexico.inegi.loader's shape: reads as much as
possible from pyCensus' parquet cache (:mod:pycensus.cache),
fetching only the logical columns actually missing, and merges the
result back into the shared per-level/region cache file.
Unlike Mexico's INEGI (a plain CSV per state), Chile's real source
(:mod:pycensus.chile.api) returns geometry and attributes together
in one GeoJSON response per level/region, cached to disk. So
_fetch_missing here re-reads the very same cached raw file that
:mod:pycensus.chile.geography already fetched for the boundary --
no second network call for the same level/region.
Only region, provincia, comuna, distrito are
implemented (see :mod:pycensus.chile.geography for why nation/
block aren't).
Source
https://services.arcgis.com/r7t1P5pnkoOLRdhr/arcgis/rest/services/ Divisi%C3%B3n_Pol%C3%ADtico_Administrativa_y_Censal/FeatureServer
load(aoi=None, regions=None, level='comuna', year='latest', cache_dir=None, cache=True, data_dir=None)
¶
Load INE Chile Censo 2017 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]]]
|
Region name(s)/code(s) to load. Derived from |
None
|
level
|
str
|
Standard geometry level name, resolved through
:data: |
'comuna'
|
year
|
Union[int, str]
|
Vintage year, or |
'latest'
|
cache_dir
|
Optional[str]
|
Root of pyCensus' parquet cache. Defaults to
:func: |
None
|
cache
|
bool
|
If |
True
|
data_dir
|
Optional[str]
|
Base directory for the raw GeoJSON cache. Defaults to
:data: |
None
|
Returns:
| Type | Description |
|---|---|
GeoDataFrame
|
GeoDataFrame with |
GeoDataFrame
|
column per logical column in :data: |
Raises:
| Type | Description |
|---|---|
ValueError
|
If neither |