tobler.dasymetric.masked_area_interpolate

tobler.dasymetric.masked_area_interpolate(source_df, target_df, raster, pixel_values, extensive_variables=None, intensive_variables=None, categorical_variables=None, allocate_total=True, nodata=255, n_jobs=-1, codes=None)[source]

Interpolate data between two polygonal datasets using an auxiliary raster to mask out uninhabited land.

Parameters:
source_dfgeopandas.GeoDataFrame

source data to be converted to another geometric representation.

target_dfgeopandas.GeoDataFrame

target geometries that will form the new representation of the input data

rasterstr

path to raster file that contains ancillary data

pixel_valueslist of ints

list of pixel values that should be considered part of the mask. For example if using data from NLCD Land Cover Database <https://www.mrlc.gov/data>, a common input might be [21,22,23,24], which match the “developed” land types in that dataset

extensive_variableslist

Columns of the input dataframe containing extensive variables to interpolate

intensive_variableslist

Columns of the input dataframe containing intensive variables to interpolate

categorical_variableslist

[Optional. Default=None] Columns in dataframes for categorical variables

allocate_totalbool

whether to allocate the total from the source geometries (the default is True).

nodataint

value in raster that indicates null or missing values. Default is 255

n_jobsint

[Optional. Default=-1] Number of processes to run in parallel to generate the area allocation. If -1, this is set to the number of CPUs available.

Returns:
geopandas.GeoDataFrame

GeoDataFrame with geometries matching the target_df and extensive and intensive variables as the columns