rasterio.enums module

Enumerations.

class rasterio.enums.ColorInterp(value)

Bases: enum.IntEnum

Raster band color interpretation.

Cb = 15
Cr = 16
Y = 14
alpha = 6
black = 13
blue = 5
cyan = 10
gray = 1
green = 4
grey = 1
hue = 7
lightness = 9
magenta = 11
palette = 2
red = 3
saturation = 8
undefined = 0
yellow = 12
class rasterio.enums.Compression(value)

Bases: enum.Enum

Available compression algorithms.

ccittfax3 = 'CCITTFAX3'
ccittfax4 = 'CCITTFAX4'
ccittrle = 'CCITTRLE'
deflate = 'DEFLATE'
jpeg = 'JPEG'
jpeg2000 = 'JPEG2000'
lerc = 'LERC'
lzma = 'LZMA'
lzw = 'LZW'
none = 'NONE'
packbits = 'PACKBITS'
webp = 'WEBP'
zstd = 'ZSTD'
class rasterio.enums.Interleaving(value)

Bases: enum.Enum

An enumeration.

band = 'BAND'
line = 'LINE'
pixel = 'PIXEL'
class rasterio.enums.MaskFlags(value)

Bases: enum.IntEnum

An enumeration.

all_valid = 1
alpha = 4
nodata = 8
per_dataset = 2
class rasterio.enums.MergeAlg(value)

Bases: enum.Enum

Available rasterization algorithms

add = 'ADD'
replace = 'REPLACE'
class rasterio.enums.PhotometricInterp(value)

Bases: enum.Enum

An enumeration.

black = 'MINISBLACK'
cielab = 'CIELAB'
cmyk = 'CMYK'
icclab = 'ICCLAB'
itulab = 'ITULAB'
rgb = 'RGB'
white = 'MINISWHITE'
ycbcr = 'YCbCr'
class rasterio.enums.Resampling(value)

Bases: enum.IntEnum

Available warp resampling algorithms.

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.

‘max’, ‘min’, ‘med’, ‘q1’, ‘q3’ are only supported in GDAL >= 2.0.0.

‘nearest’, ‘bilinear’, ‘cubic’, ‘cubic_spline’, ‘lanczos’, ‘average’, ‘mode’ are always available (GDAL >= 1.10).

‘sum’ is only supported in GDAL >= 3.1.

‘rms’ is only supported in GDAL >= 3.3.

Note: ‘gauss’ is not available to the functions in rio.warp.

average = 5
bilinear = 1
cubic = 2
cubic_spline = 3
gauss = 7
lanczos = 4
max = 8
med = 10
min = 9
mode = 6
nearest = 0
q1 = 11
q3 = 12
rms = 14
sum = 13
class rasterio.enums.WktVersion(value)

Bases: enum.Enum

New in version 1.3.0.

Supported CRS WKT string versions

WKT1 = 'WKT1'

Alias for WKT Version 1 GDAL Style

WKT1_ESRI = 'WKT1_ESRI'

WKT Version 1 ESRI Style

WKT1_GDAL = 'WKT1_GDAL'

WKT Version 1 GDAL Style

WKT2 = 'WKT2'

Alias for latest WKT Version 2

WKT2_2015 = 'WKT2_2015'

WKT Version 2 from 2015

WKT2_2019 = 'WKT2_2018'

WKT Version 2 from 2019