rasterio.enums.Resampling: fix enum docs (#3352)

* rasterio.enums.Resampling: fix enum docs

* Fix enum name

* Inline documentation
This commit is contained in:
Adam J. Stewart 2025-09-07 03:48:37 +02:00 committed by GitHub
parent 0e808c3d76
commit e2b32df87e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -4,8 +4,8 @@ from enum import Enum, IntEnum
class TransformDirection(IntEnum):
"""Coordinate transform direction
Forward transform direction defined as image pixel (row, col) to
Forward transform direction defined as image pixel (row, col) to
geographic/projected (x, y) coordinates. Reverse transform direction defined as
geographic/projected (x, y) to image pixel (row, col) coordinates.
@ -69,40 +69,7 @@ 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',
@ -121,20 +88,35 @@ class Resampling(IntEnum):
Note: 'gauss' is not available to the functions in rio.warp.
"""
nearest = 0
"""Nearest neighbor resampling (default, fastest algorithm, worst interpolation quality)."""
bilinear = 1
"""Bilinear resampling."""
cubic = 2
"""Cubic resampling."""
cubic_spline = 3
"""Cubic spline resampling."""
lanczos = 4
"""Lanczos windowed sinc resampling."""
average = 5
"""Average resampling, computes the weighted average of all non-NODATA contributing pixels."""
mode = 6
"""Mode resampling, selects the value which appears most often of all the sampled points."""
gauss = 7
"""Gaussian resampling, Note: not available to the functions in rio.warp."""
max = 8
"""Maximum resampling, selects the maximum value from all non-NODATA contributing pixels. (GDAL >= 2.0)"""
min = 9
"""Minimum resampling, selects the minimum value from all non-NODATA contributing pixels. (GDAL >= 2.0)"""
med = 10
"""Median resampling, selects the median value of all non-NODATA contributing pixels. (GDAL >= 2.0)"""
q1 = 11
"""Q1, first quartile resampling, selects the first quartile value of all non-NODATA contributing pixels. (GDAL >= 2.0)"""
q3 = 12
"""Q3, third quartile resampling, selects the third quartile value of all non-NODATA contributing pixels. (GDAL >= 2.0)"""
sum = 13
"""Sum, compute the weighted sum of all non-NODATA contributing pixels. (GDAL >= 3.1)"""
rms = 14
"""RMS, root mean square / quadratic mean of all non-NODATA contributing pixels. (GDAL >= 3.3)"""
class OverviewResampling(IntEnum):