Skip to content

Command Line

terrio <COMMAND>

  info        Summarize a raster or vector dataset
  convert     Convert a dataset to another format, optionally reprojecting it
  translate   Subset, resize, rescale or change the type of a raster (like gdal_translate)
  warp        Reproject and resample rasters (like gdalwarp)
  mosaic      Mosaic rasters into one, or into a virtual raster (like gdalbuildvrt and gdal_merge)
  rasterize   Burn vector geometries into a raster
  polygonize  Turn a raster band into polygons of connected pixels with the same value
  crs         Describe a coordinate reference system, or transform coordinates between two
  formats     List the formats terrio reads and writes

Every input can be a local path, a URL, a cloud object or a zip archive member; see Remote Data. Outputs are local. Run terrio <COMMAND> --help for the full option list.

info

terrio info INPUT [--json] [--stats] [-l LAYER]...

Prints the driver, size, bands, data types, nodata, geotransform, CRS and extent of a raster, or the layers, geometry types, feature counts, CRS, extent and fields of a vector dataset. --stats computes band minimum, maximum, mean and standard deviation over valid pixels. Remote GeoTIFFs are summarized from their header alone, and their overviews are listed.

convert

terrio convert INPUT OUTPUT [-f FORMAT] [options]
Option Applies to Meaning
-f, --format both Output driver short name (GTiff, COG, GPKG, ESRI Shapefile...)
--t-srs CRS both Reproject
--compress, --tile-size, --bigtiff rasters GeoTIFF/COG creation options
--srcwin X Y W H, --overview N rasters Read a window or an overview level
-l, --layer vectors Only these layers
--where EXPR vectors OGR SQL attribute filter
--spat XMIN YMIN XMAX YMAX, --spat-srs vectors Spatial filter
--select FIELDS, --limit N vectors Fields to keep, number of features
--sql STATEMENT vectors SELECT ... FROM ... WHERE ... ORDER BY ... LIMIT
--nln NAME, --nlt TYPE vectors New layer name, geometry type (PROMOTE_TO_MULTI...)
--explodecollections vectors One feature per part
--s-srs, --a-srs vectors Override or assign the CRS
--append, --overwrite vectors Add to or replace layers of an existing GeoPackage
--oo, --lco KEY=VALUE vectors Open and layer creation options (RFC7946=YES...)

The --where language supports comparisons, AND/OR/NOT, parentheses, IN, LIKE/ILIKE, IS [NOT] NULL, BETWEEN, arithmetic, || and FID, with OGR SQL's null semantics.

translate

terrio translate INPUT OUTPUT [options]

--srcwin, --projwin (+ --projwin-srs), -b (repeatable), --ot, --scale [SRC_MIN SRC_MAX [DST_MIN DST_MAX]], --exponent, --outsize W H (pixels or %), --tr, -r, --a-nodata, --a-srs, --a-ullr, and the output format options. Type conversion rounds and clamps as GDAL does.

warp

terrio warp INPUT... OUTPUT [options]

--t-srs, --s-srs, --tr, --te (+ --te-srs), --ts, --tap, -r (near, bilinear, cubic, cubicspline, lanczos, average, rms, mode, min, max, med, q1, q3, sum), --srcnodata, --dstnodata, --ot, --cutline (+ --crop-to-cutline), --et. Several inputs are mosaicked into one output. The default output grid follows GDAL's GDALSuggestedWarpOutput2.

mosaic

terrio mosaic INPUT... OUTPUT [options]

--resolution highest|lowest|average|user, --tr, --te, --tap, --separate, -b, --nodata, --srcnodata, --dstnodata, -r, --t-srs. A .vrt output writes a GDAL VRT that references the inputs; other outputs hold the mosaicked pixels.

rasterize

terrio rasterize INPUT OUTPUT (--burn VALUE | -a FIELD) (--tr X Y | --ts W H | --like RASTER) [options]

-l, --sql, --where, --te, --tap, --ot, --init, --a-nodata, --at (all touched), --add, --a-srs. Points, lines and polygons are burned with GDAL's algorithms, pixel for pixel.

polygonize

terrio polygonize INPUT OUTPUT [options]

-b, --field NAME (default DN), --nln, --8 (8-connectedness), --nomask, --mask RASTER, -f, --append, --overwrite. Polygons have holes; exteriors are counter-clockwise and holes clockwise.

crs

terrio crs CRS [--wkt]
terrio crs SRC --to DST X Y [X Y ...]
echo "X Y" | terrio crs SRC --to DST

formats

terrio formats [--json]