rasterio.enums module

Enumerations.

class rasterio.enums.ColorInterp(value)

Bases: IntEnum

Raster band color interpretation.

Cb = 15
Cr = 16
Y = 14
alpha = 6
black = 13
blue = 5
coastal = 18
cyan = 10
gray = 1
green = 4
grey = 1
hue = 7
lightness = 9
lwir = 23
magenta = 11
mwir = 22
nir = 20
other_ir = 25
palette = 2
pan = 17
red = 3
rededge = 19
sar_c = 34
sar_k = 31
sar_ka = 30
sar_ku = 32
sar_l = 36
sar_p = 37
sar_s = 35
sar_x = 33
saturation = 8
swir = 21
tir = 24
undefined = 0
yellow = 12
class rasterio.enums.Compression(value)

Bases: Enum

Available compression algorithms for GeoTIFFs.

Note that compression options for EXR, MRF, etc are not included in this enum.

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

Bases: Enum

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

Bases: IntEnum

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

Bases: Enum

Available rasterization algorithms

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

Bases: IntEnum

Available Overview resampling algorithms.

The first 8, ‘nearest’, ‘bilinear’, ‘cubic’, ‘cubic_spline’, ‘lanczos’, ‘average’, ‘mode’, and ‘gauss’, are available for making dataset overviews.

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

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

average = 5
bilinear = 1
cubic = 2
cubic_spline = 3
gauss = 7
lanczos = 4
mode = 6
nearest = 0
rms = 14
class rasterio.enums.PhotometricInterp(value)

Bases: Enum

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

Bases: IntEnum

Available warp resampling algorithms.

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

Average resampling, computes the weighted average of all non-NODATA contributing pixels.

bilinear = 1

Bilinear resampling.

cubic = 2

Cubic resampling.

cubic_spline = 3

Cubic spline resampling.

gauss = 7

not available to the functions in rio.warp.

Type:

Gaussian resampling, Note

lanczos = 4

Lanczos windowed sinc resampling.

max = 8

Maximum resampling, selects the maximum 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)

min = 9

Minimum resampling, selects the minimum value from all non-NODATA contributing pixels. (GDAL >= 2.0)

mode = 6

Mode resampling, selects the value which appears most often of all the sampled points.

nearest = 0

Nearest neighbor resampling (default, fastest algorithm, worst interpolation quality).

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)

rms = 14

RMS, root mean square / quadratic mean of all non-NODATA contributing pixels. (GDAL >= 3.3)

sum = 13

Sum, compute the weighted sum of all non-NODATA contributing pixels. (GDAL >= 3.1)

class rasterio.enums.TransformDirection(value)

Bases: IntEnum

Coordinate transform direction

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.

Notes

The convention for transform direction for RPC based coordinate transform is typically the opposite of what is previously described. For consistency all coordinate transforms methods use the same convention.

forward = 1
reverse = 0
class rasterio.enums.TransformMethod(value)

Bases: Enum

affine = 'transform'
gcps = 'gcps'
rpcs = 'rpcs'
class rasterio.enums.WktVersion(value)

Bases: Enum

Added 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