reVeal.overlay.calc_median#
- calc_median(zones_df, dset_src, parallel=False, max_workers=None, **kwargs)[source]#
Calculate zonal median of raster values over the input zones.
- Parameters:
zones_df (geopandas.GeoDataFrame) – Input zones dataframe, to which results will be aggregated. This function assumes that the index of zones_df is unique for each feature. If this is not the case, unexpected results may occur.
dset_src (str) – Path to input raster dataset to be summarized.
parallel (bool, optional) – If True, run the zonal statistic operation with parallel processing. If False (default), run with serial processing.
max_workers (int, optional) – If specified, sets the maximum number of workers used in parallel processing. By default, None, which will use all available workers.
- Returns:
pandas.DataFrame – Returns a pandas DataFrame with a “value” column, representing the median raster value within each zone. The index from the input zones_df is also included.