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_df : geopandas.GeoDataFrame (required)¶
geodataframe with polygon geometries and data to transfer
- target_df : geopandas.GeoDataFrame (required)¶
geodataframe with polygon geometries to receive new data
- variables : list¶
columns on the source_df containing data to transfer
- cellsize : int¶
Pixel size of intermediate raster in planar units (i.e. metres, feet)
- r : float, optional¶
Relaxation parameter, default of 0.2 is generally fine
- handle_null : bool, optional¶
Changes how nodata values are smoothed. Default True.
- converge : int, optional¶
Index for stopping value, default 3 is generally fine.
- verbose : bool, optional¶
Print out progress at each iteration.
- Returns:¶
new geodataframe with interpolated variables as columns and target_df geometry as output geometry
- Return type:¶
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: [Tobler, 1979]