tobler.pycno.pycno_interpolate

tobler.pycno.pycno_interpolate(source_df, target_df, variables, cellsize, r=0.2, handle_null=True, converge=3, verbose=False)[source]

Pycnophylactic Inerpolation.

Parameters:
source_dfgeopandas.GeoDataFrame (required)

geodataframe with polygon geometries and data to transfer

target_dfgeopandas.GeoDataFrame (required)

geodataframe with polygon geometries to receive new data

variableslist

columns on the source_df containing data to transfer

cellsizeint

Pixel size of intermediate raster in planar units (i.e. metres, feet)

rfloat, optional

Relaxation parameter, default of 0.2 is generally fine

handle_nullbool, optional

Changes how nodata values are smoothed. Default True.

convergeint, optional

Index for stopping value, default 3 is generally fine.

verbosebool, optional

Print out progress at each iteration.

Returns:
geopandas.GeoDataFrame

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

Notes

The formula is based on Tobler, W. R. (1979). Smooth pycnophylactic interpolation for geographical regions. Journal of the American Statistical Association, 74(367), 519–529. https://doi.org/10.1080/01621459.1979.10481647

Original implementation written by @danlewis85 at <https://github.com/danlewis85/pycno/> and based in part on the R pycno package by Chris Brusndon (<https://cran.r-project.org/web/packages/pycno/index.html>)

References: [29]