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_dfgeopandas.GeoDataFrame
target_dfgeopandas.GeoDataFrame
extensive_variableslist

columns in dataframes for extensive variables

intensive_variableslist

columns in dataframes for intensive variables

tablescipy.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.

Returns
estimatesgeopandas.GeoDataFrame

new geodaraframe with interpolated variables as columns and target_df geometry as output geometry

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} \]