pycensus.census.countries.spain.mobility.resample¶
Zone -> census-section resampling for mobility survey results (modal split, trips, distance).
A mobility survey is published on its OWN zoning (traffic zones, districts, municipalities, comarcas ...). zones_to_sections moves the
zone values onto census sections: every section takes the population-weighted mean of the zones it overlaps, where each overlap piece
carries the section's population in proportion to its area (population spread evenly over the section). Intensive columns (shares, trips
per person, km per person) are averaged this way; extensive columns (trip counts, km) are split among sections by the same weights.
zones_to_sections(zones, sections, intensive=(), extensive=(), zone_id='zone_id', section_id='CUSEC', pop_col='population')
¶
Values per section (index section_id) from zone values. Sections no zone reaches get NaN.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
zones
|
GeoDataFrame
|
Zones with values. |
required |
sections
|
GeoDataFrame
|
Census sections with population. |
required |
intensive
|
Iterable[str]
|
Rate columns (population-weighted). |
()
|
extensive
|
Iterable[str]
|
Count columns (split by population). |
()
|
zone_id
|
str
|
Zone id column. |
'zone_id'
|
section_id
|
str
|
Section id column. |
'CUSEC'
|
pop_col
|
str
|
Section population column. |
'population'
|