rasterio.rio.options module

Registry of common rio CLI options. See cligj for more options.

-a, --all: Use all pixels touched by features.  In rio-mask, rio-rasterize
--as-mask/--not-as-mask: interpret band as mask or not.  In rio-shapes
--band/--mask: use band or mask.  In rio-shapes
-b, --bidx: band index(es) (singular or multiple value versions).
    In rio-info, rio-sample, rio-shapes, rio-stack (different usages)
--bounds: bounds in world coordinates.
    In rio-info, rio-rasterize (different usages)
--count: count of bands.  In rio-info
--crop: Crop raster to extent of features.  In rio-mask
--crs: CRS of input raster.  In rio-info
--default-value: default for rasterized pixels.  In rio-rasterize
--dimensions: Output width, height.  In rio-rasterize
--dst-crs: destination CRS.  In rio-transform
--fill: fill value for pixels not covered by features.  In rio-rasterize
--formats: list available formats.  In rio-info
--height: height of raster.  In rio-info
-i, --invert: Invert mask created from features: In rio-mask
-j, --geojson-mask: GeoJSON for masking raster.  In rio-mask
--lnglat: geograhpic coordinates of center of raster.  In rio-info
--masked/--not-masked: read masked data from source file.
    In rio-calc, rio-info
-m, --mode: output file mode (r, r+).  In rio-insp
--name: input file name alias.  In rio-calc
--nodata: nodata value.  In rio-info, rio-merge (different usages)
--photometric: photometric interpretation.  In rio-stack
--property: GeoJSON property to use as values for rasterize.  In rio-rasterize
-r, --res: output resolution.
    In rio-info, rio-rasterize (different usages.  TODO: try to combine
    usages, prefer rio-rasterize version)
--sampling: Inverse of sampling fraction.  In rio-shapes
--shape: shape (width, height) of band.  In rio-info
--src-crs: source CRS.
    In rio-insp, rio-rasterize (different usages.  TODO: consolidate usages)
--stats: print raster stats.  In rio-inf
-t, --dtype: data type.  In rio-calc, rio-info (different usages)
--width: width of raster.  In rio-info
--with-nodata/--without-nodata: include nodata regions or not.  In rio-shapes.
-v, --tell-me-more, --verbose
--vfs: virtual file system.

Return forward-slashed version of os.path.abspath

rasterio.rio.options.bounds_handler(ctx, param, value)

Handle different forms of bounds.

rasterio.rio.options.edit_nodata_handler(ctx, param, value)

Get nodata value from a template file or command line.

Expected values are ‘like’, ‘null’, a numeric value, ‘nan’, or None.

Return type:

float or None



rasterio.rio.options.file_in_handler(ctx, param, value)

Normalize ordinary filesystem and VFS paths

rasterio.rio.options.files_in_handler(ctx, param, value)

Process and validate input file names

rasterio.rio.options.files_inout_handler(ctx, param, value)

Process and validate input file names

rasterio.rio.options.from_like_context(ctx, param, value)

Return the value for an option from the context if the option or –all is given, else return None.

rasterio.rio.options.like_handler(ctx, param, value)

Copy a dataset’s meta property to the command context for access from other callbacks.

rasterio.rio.options.nodata_handler(ctx, param, value)

Return a float or None