tobler.area_weighted.area_interpolate¶
-
tobler.area_weighted.
area_interpolate
(source_df, target_df, extensive_variables=None, intensive_variables=None, table=None, allocate_total=True)[source]¶ Area interpolation for extensive and intensive variables.
- Parameters
- source_df
geopandas.GeoDataFrame
- target_df
geopandas.GeoDataFrame
- extensive_variables
list
columns in dataframes for extensive variables
- intensive_variables
list
columns in dataframes for intensive variables
- table
scipy.sparse.dok_matrix
- allocate_totalbool
True if total value of source area should be allocated. False if denominator is area of i. Note that the two cases would be identical when the area of the source polygon is exhausted by intersections. See Notes for more details.
- source_df
- Returns
- estimates
geopandas.GeoDataFrame
new geodaraframe with interpolated variables as columns and target_df geometry as output geometry
- estimates
Notes
The assumption is both dataframes have the same coordinate reference system. For an extensive variable, the estimate at target polygon j (default case) is:
\[ \begin{align}\begin{aligned}v_j = \sum_i v_i w_{i,j}\\w_{i,j} = a_{i,j} / \sum_k a_{i,k}\end{aligned}\end{align} \]If the area of the source polygon is not exhausted by intersections with target polygons and there is reason to not allocate the complete value of an extensive attribute, then setting allocate_total=False will use the following weights:
\[ \begin{align}\begin{aligned}v_j = \sum_i v_i w_{i,j}\\w_{i,j} = a_{i,j} / a_i\end{aligned}\end{align} \]where a_i is the total area of source polygon i. For an intensive variable, the estimate at target polygon j is:
\[ \begin{align}\begin{aligned}v_j = \sum_i v_i w_{i,j}\\w_{i,j} = a_{i,j} / \sum_k a_{k,j}\end{aligned}\end{align} \]