rio edit_info
Edit a dataset’s metadata: coordinate reference system, affine transformation matrix, nodata value, and tags.
The coordinate reference system may be either a PROJ.4 or EPSG:nnnn string,
–crs ‘EPSG:4326’
or a JSON text-encoded PROJ.4 object.
–crs ‘{“proj”: “utm”, “zone”: 18, …}’
Transforms are JSON-encoded Affine objects like:
–transform ‘[300.038, 0.0, 101985.0, 0.0, -300.042, 2826915.0]’
Prior to Rasterio 1.0 GDAL geotransforms were supported for –transform, but are no longer supported.
Metadata items may also be read from an existing dataset using a combination of the –like option with at least one of –all, –crs like, –nodata like, and –transform like.
rio edit-info example.tif –like template.tif –all
To get just the transform from the template:
rio edit-info example.tif –like template.tif –transform like
rio edit_info [OPTIONS] INPUT
Options
- -b, --bidx <bidx>
Input file band index (default: 1).
- --nodata <NUMBER|nan|null>
Modify the Nodata value.
- --unset-nodata
Unset the dataset’s nodata value.
- --crs <crs>
New coordinate reference system
- --unset-crs
Unset the dataset’s CRS value.
- --transform <transform>
New affine transform matrix
- --units <units>
Edit units of a band (requires –bidx)
- --description <description>
Edit description of a band (requires –bidx)
- --tag <KEY=VAL>
New tag.
- --all
Copy all metadata items from the template file.
- --colorinterp <name[,name,...]|RGB|RGBA|like>
Set color interpretation for all bands like ‘red,green,blue,alpha’. Can also use ‘RGBA’ as shorthand for ‘red,green,blue,alpha’ and ‘RGB’ for the same sans alpha band. Use ‘like’ to inherit color interpretation from ‘–like’.
- --like <like>
Raster dataset to use as a template for obtaining affine transform (bounds and resolution), crs, and nodata values.
Arguments
- INPUT
Required argument