diff --git a/rasterio/enums.py b/rasterio/enums.py index afd7ae5a..9a0cd9d8 100644 --- a/rasterio/enums.py +++ b/rasterio/enums.py @@ -27,7 +27,42 @@ class ColorInterp(IntEnum): class Resampling(IntEnum): """Available warp resampling algorithms. - + + Attributes + ---------- + nearest + Nearest neighbor resampling (default, fastest algorithm, worst interpolation quality). + bilinear + Bilinear resampling. + cubic + Cubic resampling. + cubic_spline + Cubic spline resampling. + lanczos + Lanczos windowed sinc resampling. + average + Average resampling, computes the weighted average of all non-NODATA contributing pixels. + mode + Mode resampling, selects the value which appears most often of all the sampled points. + gauss + Gaussian resampling, Note: not available to the functions in rio.warp. + max + Maximum resampling, selects the maximum value from all non-NODATA contributing pixels. (GDAL >= 2.0) + min + Minimum resampling, selects the minimum value from all non-NODATA contributing pixels. (GDAL >= 2.0) + med + Median resampling, selects the median value of all non-NODATA contributing pixels. (GDAL >= 2.0) + q1 + Q1, first quartile resampling, selects the first quartile value of all non-NODATA contributing pixels. (GDAL >= 2.0) + q3 + Q3, third quartile resampling, selects the third quartile value of all non-NODATA contributing pixels. (GDAL >= 2.0) + sum + Sum, compute the weighted sum of all non-NODATA contributing pixels. (GDAL >= 3.1) + rms + RMS, root mean square / quadratic mean of all non-NODATA contributing pixels. (GDAL >= 3.3) + + Notes + ---------- The first 8, 'nearest', 'bilinear', 'cubic', 'cubic_spline', 'lanczos', 'average', 'mode', and 'gauss', are available for making dataset overviews. diff --git a/rasterio/warp.py b/rasterio/warp.py index 18270fe6..15a37cc1 100644 --- a/rasterio/warp.py +++ b/rasterio/warp.py @@ -257,20 +257,9 @@ def reproject(source, destination=None, src_transform=None, gcps=None, rpcs=None Index of a band to use as the alpha band when warping. dst_alpha : int, optional Index of a band to use as the alpha band when warping. - resampling: int - Resampling method to use. One of the following: - Resampling.nearest, - Resampling.bilinear, - Resampling.cubic, - Resampling.cubic_spline, - Resampling.lanczos, - Resampling.average, - Resampling.mode, - Resampling.max (GDAL >= 2.2), - Resampling.min (GDAL >= 2.2), - Resampling.med (GDAL >= 2.2), - Resampling.q1 (GDAL >= 2.2), - Resampling.q3 (GDAL >= 2.2) + resampling: int, rasterio.enums.Resampling + Resampling method to use. + Default is :attr:`rasterio.enums.Resampling.nearest`. An exception will be raised for a method not supported by the running version of GDAL. num_threads : int, optional