7.1. GeoTIFF Writer

The GeoTIFF writer puts gridded image data into a standard GeoTIFF file.

It uses the GDAL python API and rasterio python package to create the GeoTIFF files. It can handle any grid that can be described by PROJ.4 and understood by the GeoTIFF format.

By default the ‘geotiff’ writer will add an “Alpha” band to the file to mark any invalid or missing data pixels. This results in invalid pixels showing up as transparent in most image viewers.

7.1.1. Command Line Arguments

usage: |script| -r <reader> -w geotiff [-h] [--output-filename FILENAME] [--dtype {uint8,uint16,uint32,uint64,int8,int16,int32,int64,float32,float64}] [--no-enhance] [--fill-value FILL_VALUE] [--compress COMPRESS] [--keep-palette]
                                       [--tiled | --no-tiled] [--blockxsize BLOCKXSIZE] [--blockysize BLOCKYSIZE] [--overviews OVERVIEWS] [--overviews-resampling {nearest,average,bilinear,cubic,cubicspline,lanczos}]
                                       [--gdal-driver DRIVER]

7.1.1.1. Geotiff Writer

--output-filename

Custom file pattern to save dataset to

--dtype

Possible choices: uint8, uint16, uint32, uint64, int8, int16, int32, int64, float32, float64

Data type of the output file (8-bit unsigned integer by default - uint8)

--no-enhance

Don’t try to enhance the data before saving it

--fill-value

Instead of an alpha channel fill invalid values with this value. Turns LA or RGBA images in to L or RGB images respectively.

--compress

File compression algorithm (DEFLATE, LZW, NONE, etc)

Default: “LZW”

--keep-palette

When saving ‘palettized’ enhanced images, save the colormap as a geotiff color table instead of converting the image to RGB/A

--tiled, --no-tiled

Tile geotiffs internally (default: True)

Default: True

--blockxsize

Set tile block X size

--blockysize

Set tile block Y size

--overviews

Build lower resolution versions of your image for better performance in some clients. Specified as a space separate list of numbers, typically as powers of 2. Example: ‘2 4 8 16’

--overviews-resampling

Possible choices: nearest, average, bilinear, cubic, cubicspline, lanczos

Specify resampling used when generating overviews

Default: “nearest”

--gdal-driver

Name of the GDAL driver to use when writing the geotiff. By default the ‘geotiff’ driver is used. If ‘–driver COG’ is used then the GDAL ‘COG’ driver will be used and will create a tiled COG-compatible geotiff.