rio convert

Copy and convert raster datasets to other data types and formats.

Data values may be linearly scaled when copying by using the –scale-ratio and –scale-offset options. Destination raster values are calculated as

dst = scale_ratio * src + scale_offset

For example, to scale uint16 data with an actual range of 0-4095 to 0-255 as uint8:

$ rio convert in16.tif out8.tif –dtype uint8 –scale-ratio 0.0625

Format specific creation options may also be passed using –co. To tile a new GeoTIFF output file, do the following.

–co tiled=true –co blockxsize=256 –co blockysize=256

To compress it using the LZW method, add

–co compress=LZW

rio convert [OPTIONS] INPUTS... OUTPUT

Options

-o, --output <output>

Path to output file (optional alternative to a positional arg).

-f, --format, --driver <driver>

Output format driver

-t, --dtype <dtype>

Output data type.

Options

ubyte | uint8 | uint16 | int16 | uint32 | int32 | float32 | float64

--scale-ratio <scale_ratio>

Source to destination scaling ratio.

--scale-offset <scale_offset>

Source to destination scaling offset.

--rgb

Set RGB photometric interpretation.

--overwrite

Always overwrite an existing output file.

--co, --profile <NAME=VALUE>

Driver specific creation options. See the documentation for the selected output driver for more information.

Arguments

INPUTS... OUTPUT

Required argument(s)