Terraflux Terraflux
Download

Data preparation

53 operators. Inputs marked required must be connected or given; the others have defaults.

data.download#

Data downloaded on demand and warped onto a grid (gdalwarp straight from the servers: only the part the grid covers is read): WorldClim 2.1 (the 1970-2000 climate; CMIP6 futures), CHELSA 2.1 (1981-2010; CMIP6 futures), the Copernicus DEM (30 or 90 m), SoilGrids (a property at depths) and MapBiomas Brazil (land use and cover by year), Hydrography90m (the river network of the world at 90 m: its sub-catchments, segments, basins, flow directions and accumulation, stream orders, slopes and distances), ESA WorldCover (land cover at 10 m, 2020 and 2021), Hansen's Global Forest Change (tree cover in 2000, the year of loss, gain, at 30 m), MODIS from Microsoft's Planetary Computer (the vegetation indices NDVI and EVI, 16-day at 250 m; the land surface temperature of the day and the night, 8-day at 1 km; the burned area, monthly at 500 m; the yearly gross and net primary production at 500 m), or any raster a url names; a file per layer kept in the cache (Terraflux's, TERRAFLUX_CACHE), downloaded once. Classes are resampled by the most common cell, values bilinearly. The values are the servers' (CHELSA's scaled integers: × 0.1, and - 273.15 for temperatures; SoilGrids' in its mapped units; MODIS' indices and production × 0.0001, its temperatures × 0.02 in kelvin, its burned area the day of the year, 0 unburned).

InputTypeWhat it is
likerasterthe map whose grid to fill (else extent and cellsize)
areavectorpolygons to cut the data to (an area drawn): no data outside them; without like and extent, the grid spans them
OutputTypeWhat it is
rasterrasterthe layers on the grid, a file each
SettingTypeWhat it is
sourcetextthe data (or url instead)
variabletextworldclim: bio (default), tavg, tmin, tmax, prec, srad, wind, vapr, elev; worldclim_future: bioc (default), tmin, tmax, prec; hydrography90m: sub_catchment (default), segment, basin, outlet, direction, accumulation, order_strahler... (hydrographr's names); global_forest_change: treecover2000 (default), lossyear, gain, datamask; modis: ndvi (default), evi, lst_day, lst_night, burned, gpp, npp
layersanythe variables' numbers (bio 1-19, months 1-12; default all)
resolutiontextworldclim and worldclim_future: 10m (default), 5m, 2.5m, 30s
gcmtextthe climate model of a future (default MPI-ESM1-2-HR)
ssptextthe scenario: 126, 245 (WorldClim's default), 370 (CHELSA's), 585
periodtexta future's years (WorldClim 2021-2040, 2041-2060 (default), 2061-2080, 2081-2100; CHELSA 2011-2040, 2041-2070 (default), 2071-2100)
dem_resolutionintegercopernicus_dem: 30 or 90 m (default)
propertytextsoilgrids: soc (default), phh2o, clay, sand, silt, bdod, cec, cfvo, nitrogen, ocd
depthanysoilgrids: 0-5cm (default), 5-15cm, ... 100-200cm, or a list
stattextsoilgrids: mean (default), Q0.05, Q0.5, Q0.95, uncertainty
collectionintegermapbiomas: 9, 10 (default) or 11
yearsanymapbiomas: a year or a list (default 2023); esa_worldcover: 2020 or 2021 (default), or both
dateanymodis: a date, YYYY-MM-DD (the composite, month or year begun on it or last before it; default 2024-07-01), or a list
urlanyany raster GDAL reads (a URL, a path), or a list
extentanywithout like: [west, south, east, north], degrees
cellsizenumberwith extent or an area: the cells' side, degrees (an area's default: its longer side in 500 cells)
resamplingtextauto (default), near, bilinear, cubic, average, mode... (gdalwarp's)

data.environment90m#

The environment of every sub-catchment of a map of Hydrography90m's sub-catchments (data.download's hydrography90m), from Environment90m (Garcia Marquez et al. 2025), as hydrographr's download_env90m_tables: the climate (CHELSA's bio01 to bio19, observed 1981-2010 and projected), the land cover (ESA CCI's share of each class by year), the soil (SoilGrids), the elevation (MERIT DEM), the aridity and evapotranspiration (CGIAR) and the hydrography's variables, each summarised over the sub-catchment, in the units of their sources (CHELSA's temperatures in tenths of a kelvin: x 0.1 - 273.15 for degrees). The tables of the tiles over the map downloaded once into the cache (some are hundreds of MB), the rows of the map's sub-catchments kept.

InputTypeWhat it is
sub_catchmentsrequiredmapthe sub-catchment of each cell (Hydrography90m's ids)
OutputTypeWhat it is
tabletablea row per sub-catchment of the map: subcID, then _ for each variable and statistic
mapmapthe column to_map on the cells of each sub-catchment
SettingTypeWhat it is
variablesrequiredanythe variables, a name or a list, as hydrographr's: bio01_1981-2010_observed, bio12_2071-2100_gfdl-esm4_ssp370_v2_1, c10_2020 (land cover class 10 in 2020), clyppt (clay), elev, garid (aridity), slope_grad_dw_cel...
statsanymin, max, range, mean (default), sd, or a list
to_maptextthe column of the map (the first after subcID)

raster.calc#

Maps, stacks and numbers computed cell by cell from a script over the node's inputs (any names: maps, numbers, stacks), as Dinamica EGO's Calculate Map, in Python's syntax: arithmetic (+ - * / % **), comparisons (chained: 5 <= x < 8), and/or/not, a if c else b, None (a missing value), True, False, abs sqrt exp log log10 floor ceil round min max clamp isnull coalesce, the neighbourhood functions nbsum nbmean nbmin nbmax nbcount(x, radius), a stack's layers as s.layer, an operation on a stack made on each layer, mean sd median sum count min max percentile(s, p) of a stack's layers at each cell, and x.mean() x.sd() x.median() x.sum() x.count() x.min() x.max() x.percentile(p), a number from all the cells. One statement a line (# a comment): name = value, name[where] = value, s.layer = value, and out name = value (or out name) for each output, a map, a stack or a number; without out, the last value is the map. A missing value gives a missing cell.

OutputTypeWhat it is
mapmapthe map computed (by a script without out)
SettingTypeWhat it is
expressionrequiredtextthe script (an expression of one line is a script too), e.g. forest = landuse == 3; out steep = forest and slope > 20

Takes any other inputs by name (any).

raster.cell_area#

The true area of every cell of a map's grid, as terra's cellSize: on a grid of longitudes and latitudes the area of the cell on the WGS84 ellipsoid (exact, by its latitudes: smaller towards the poles), on a projected grid its width times its height (in metres by the grid's unit). In square metres, hectares or km²: a map of classes times it is each cell's area of the class.

InputTypeWhat it is
maprequiredmapa map on whose grid the areas are made
OutputTypeWhat it is
mapmapthe area of every cell
SettingTypeWhat it is
unitstextm2 (default), hectares or km2
geographictextauto (by the coordinate system, default), yes or no

raster.classify#

A map's values in classes 1.. by breaks, as a GIS's graduated symbology or classInt: quantiles (each class a share of the cells), equal intervals, Jenks's natural breaks (of at most sample values spread evenly over the sorted cells), standard deviations (breaks at the mean and every sd_width standard deviations from it, as QGIS's), or the breaks given. A class holds the values above its lower break up to its upper one (the first its lower too), as R's cut.

InputTypeWhat it is
maprequiredmapthe values
OutputTypeWhat it is
mapmapthe class of every cell
tabletablea row per class: class, from, to, cells, share
SettingTypeWhat it is
methodtextquantile (default), equal, jenks, sd or breaks
nintegerthe classes (5)
breaksanybreaks: the values between classes
sd_widthnumbersd: the classes' width in standard deviations (1)
sampleintegerjenks: at most so many values (10000)

raster.clip#

Rasters cut to an extent in their own coordinates (GDAL's gdal_translate), their cells as they are.

InputTypeWhat it is
rasterrequiredrasterthe rasters
OutputTypeWhat it is
rasterrasterthe rasters cut
SettingTypeWhat it is
extentrequiredany[xmin, ymin, xmax, ymax]
pathtextthe file (or folder, for a series) made; else a cache

raster.contour#

The contour lines of a map, as gdal_contour: lines through the places of equal value, at every multiple of an interval from a base (or at the levels given), traced by marching squares between the cells' centres (linear between two), each line's level as an attribute; the squares of a cell without a value left out.

InputTypeWhat it is
maprequiredmapthe map (an elevation, say)
OutputTypeWhat it is
vectorvectorthe lines, each with its level
tabletablethe feature (1..) and its level
SettingTypeWhat it is
intervalnumberthe distance between levels (e.g. 10 m)
basenumbera level the others are multiples of the interval from (0)
levelsanythe levels, in place of an interval

raster.convert#

Rasters copied into another format or cell type (gdal_translate): GTiff, COG (cloud-optimised, with overviews), HFA (Erdas .img), netCDF, KEA...; the type Byte, Int16, UInt16, Int32, Float32...

InputTypeWhat it is
rasterrequiredrasterthe rasters
OutputTypeWhat it is
rasterrasterthe rasters converted
SettingTypeWhat it is
formattextGDAL's format (default GTiff; COG, HFA, netCDF...)
typetextthe cell type: Byte, Int16, UInt16, Int32, Float32, Float64
optionstextmore of gdal_translate's options, as on its command line
pathtextthe file (or folder, for a series) made; else a cache

raster.correlation#

The correlation and covariance between maps over their cells, as terra's layerCor or R's cor: between every two layers of a stack (or of a series of maps), and those of y when given; Pearson's or Spearman's (of the ranks, ties given their mean rank). Every pair over the cells where both have a value; with the least squares line of the second on the first.

InputTypeWhat it is
xrequiredanya map, a stack or a series of maps
yanyanother map or stack (of the same grid)
OutputTypeWhat it is
matrixtablethe correlations: a row per layer (1..), a column per layer by its name
covariancetablethe covariances (n - 1), as the matrix
pairstablea row per pair of layers: x, y (the layers), n (cells), correlation, covariance, slope, intercept, r2
SettingTypeWhat it is
methodtextpearson (default) or spearman

raster.expand#

Classes of a map grown a number of cells into the others, as ArcGIS's Expand: a cell a step, every cell beside one of the classes taking the most common of them around it (a tie: the smallest). The cells without a value stay so, unless into_missing.

InputTypeWhat it is
maprequiredmapthe classes
OutputTypeWhat it is
mapmapthe classes grown
SettingTypeWhat it is
classesrequiredanythe classes grown (one or a list)
cellsintegerhow many cells (1)
neighboursinteger4 or 8 (default)
into_missingboolinto the cells without a value too (false)

raster.fill#

The cells without a value filled from the cells around them (gdal_fillnodata: inverse distance weighting, up to a distance), then smoothed if asked.

InputTypeWhat it is
rasterrequiredrasterthe rasters
OutputTypeWhat it is
rasterrasterthe rasters filled
SettingTypeWhat it is
max_distancenumberthe farthest a value is taken from, in cells (100)
smoothingintegersmoothing passes over the cells filled (0)
pathtextthe file (or folder, for a series) made; else a cache

raster.focal#

A statistic of the cells in a moving window around every cell, as terra's focal or GRASS's r.neighbors: the mean, median, majority (the mode), standard deviation, variety (unique), range, minimum, maximum, sum, count, a percentile... (the statistics of vector.zonal) over the window's cells with a value; the window a square, a circle, an annulus (a ring between two radii) or a Gaussian kernel (the mean or sum weighted by exp(-d² / 2σ²)). No value where the cell has none, unless fill.

InputTypeWhat it is
maprequiredmapthe map
OutputTypeWhat it is
mapmapthe statistic of every cell's window
SettingTypeWhat it is
stattextmean (default), median, majority, minority, std, var, unique (variety), range, min, max, sum, count, nodata, percentile_

shapetextsquare (default), circle, annulus or gaussian
radiusintegerthe window's radius in cells (1: 3 x 3)
innerintegerannulus: the inner radius, its cells left out (radius / 2)
sigmanumbergaussian: the standard deviation in cells (radius / 2)
fillboola value also where the cell has none (false)

raster.label#

The patches of a map numbered, as GRASS's r.clump or scipy's label: every group of connected cells of one value given an id (1.., in the order of their first cell, row by row), with a table of each patch's value, cells and area. Only the classes given, when given; the cells without a value in none.

InputTypeWhat it is
maprequiredmapthe classes
OutputTypeWhat it is
mapmapthe id of every cell's patch
tabletablea row per patch: id, value, cells, area (map units squared)
SettingTypeWhat it is
neighboursinteger4 (default) or 8
classesanythe classes labelled (default every one)

raster.legend#

The names and colours of a map's classes: the map shown with them, and carried with it (the maps made from it that keep its classes, the GeoTIFF it is written to); the viewer's legend editor writes them here. Rasters on disk are shown so, not read.

InputTypeWhat it is
maprequiredrasterthe map of classes
OutputTypeWhat it is
maprasterthe same map, with its legend
SettingTypeWhat it is
classesrequiredany[[value, "name", "#rrggbb"], ...]

raster.local_correlation#

The correlation and the least squares line between two maps in a moving window around every cell (geographically local regression, as terra's focalPairs or focalReg): Pearson's correlation, the slope and intercept of y on x and r², over the cells of the window where both have a value. No value where a map has none at the cell, or the window fewer than min_cells pairs.

InputTypeWhat it is
xrequiredmapthe first map
yrequiredmapthe second map (of the same grid)
OutputTypeWhat it is
correlationmapPearson's correlation in the window
slopemapthe slope of y on x
interceptmapthe intercept of y on x
r2mapthe share of y's variance the line explains
SettingTypeWhat it is
radiusintegerthe window's radius in cells (3: 7 x 7)
shapetextsquare (default) or circle
min_cellsintegerthe fewest pairs of a window (3)

raster.majority#

A map of classes cleaned by the majority filter, as ArcGIS's Majority Filter: a cell takes the most common class of its neighbours (with a value) when more than half of them hold it (replace majority) or at least half (half); a tie between classes keeps the cell. Repeated iterations times, each on the map the one before left.

InputTypeWhat it is
maprequiredmapthe classes
OutputTypeWhat it is
mapmapthe classes filtered
SettingTypeWhat it is
neighboursinteger4 or 8 (default): the cells around, or a diamond and a square of the radius
radiusintegerthe neighbourhood's radius in cells (1)
replacetextmajority (more than half, default) or half (at least half)
iterationsintegerthe times the filter is applied (1)

raster.match#

Rasters on the grid of another (its CRS, extent and cells: landschaft's match_grid, by gdalwarp), so that their cells are the same cells; the method by the data unless one is given.

InputTypeWhat it is
rasterrequiredrasterthe rasters
likerequiredrasterthe raster whose grid to take
OutputTypeWhat it is
rasterrasterthe rasters on that grid
SettingTypeWhat it is
resamplingtextauto (default), near, bilinear, average, mode...
source_crstextthe rasters' CRS, when their files do not say it
pathtextthe file (or folder, for a series) made; else a cache

raster.mosaic#

The files of a series (a folder, a pattern: tiles of a region) joined into one raster (gdalwarp), in the CRS of the first unless another is given; where they overlap, the cells of the last.

InputTypeWhat it is
rasterrequiredrasterthe rasters: a series of files
OutputTypeWhat it is
rasterrasterthe mosaic
SettingTypeWhat it is
crstextthe CRS of the mosaic (default: the first file's)
resolutionanythe side of the mosaic's cells, or [x, y]
resamplingtextauto (default), near, bilinear, average, mode...
pathtextthe file made; else a cache

raster.read#

A raster: a file, or a folder or a pattern (forest/*.tif) for every raster in it as one stack (a layer per band of each file, by the files' names; files of different grids are shown, and made one grid by raster.match before they are a stack). Only their headers are read: they are shown at once whatever their size, and read whole when a node needs them: one band where a node takes a raster (the band chosen, else the first), every band where it takes a stack.

OutputTypeWhat it is
rasterrasterthe raster (or the stack of its bands, of the files)
SettingTypeWhat it is
pathrequiredtexta file, a folder (a stack) or a pattern, relative to the model's folder
bandtextthe band where a node takes a raster or any value (map algebra), by name or 0-based number (default the first)
nodatanumbera no-data value replacing the files'
firstintegera folder: only its first files, this many (to try the nodes after it on a few before all)
workersintegera folder whose files the nodes after it run on one by one: how many files at the same time (default the threads; fewer for large files, each in memory while it runs)

raster.reclassify#

A map's values changed by rules, one per line: 1 2 3 -> 1 (values), 0..10 -> 2 (a range, both ends in; also written 0 10 2, from, to, becomes), * -> nan (every other value); values no rule takes stay as they are. The first rule that takes a value gives it.

InputTypeWhat it is
maprequiredmapthe map
OutputTypeWhat it is
mapmapthe map reclassified
SettingTypeWhat it is
rulesrequiredtextthe values -> their new value, a rule per line: 3 -> 1, 1 2 -> 1, 0..10 -> 2 (or 0 10 2: from, to, becomes), * -> 0, 5 -> nan

raster.reproject#

Rasters in another coordinate reference system and/or resolution (GDAL's gdalwarp): the method by the data unless one is given (classes: the nearest cell, or the most common when the cells grow; values: bilinear, or the mean when the cells grow). A series is done file by file.

InputTypeWhat it is
rasterrequiredrasterthe rasters
OutputTypeWhat it is
rasterrasterthe rasters reprojected
SettingTypeWhat it is
crstextthe new CRS: EPSG:4326, a WKT, a PROJ string (default: the same)
resolutionanythe new cells' side, or [x, y], in the new CRS's units
resamplingtextauto (default), near, bilinear, cubic, average, mode, min, max...
source_crstextthe rasters' CRS, when their files do not say it
extentany[xmin, ymin, xmax, ymax] in the new CRS
optionstextmore of gdalwarp's options, as on its command line
pathtextthe file (or folder, for a series) made; else a cache

raster.resample#

Rasters at another resolution in their own CRS (gdalwarp): the method by the data unless one is given (classes: the nearest cell, or the most common when the cells grow; values: bilinear, or the mean when the cells grow).

InputTypeWhat it is
rasterrequiredrasterthe rasters
OutputTypeWhat it is
rasterrasterthe rasters resampled
SettingTypeWhat it is
resolutionrequiredanythe new cells' side, or [x, y], in the rasters' units
resamplingtextauto (default), near, bilinear, cubic, average, mode...
pathtextthe file (or folder, for a series) made; else a cache

raster.shrink#

Classes of a map shrunk a number of cells, as ArcGIS's Shrink: a cell a step, every cell of the classes beside another value taking the most common of those around it (a tie: the smallest). A cell beside none but cells without a value stays.

InputTypeWhat it is
maprequiredmapthe classes
OutputTypeWhat it is
mapmapthe classes shrunk
SettingTypeWhat it is
classesrequiredanythe classes shrunk (one or a list)
cellsintegerhow many cells (1)
neighboursinteger4 or 8 (default)

raster.sieve#

The patches smaller than a size merged into their largest neighbour, as gdal_sieve (GDALSieveFilter): a map of classes rid of its specks, the smallest patches first, each taking the value of the largest patch it touches (a patch grown by the merge counts as its new size). A patch touching none (all around without a value) stays. The cells without a value stay so.

InputTypeWhat it is
maprequiredmapthe classes
OutputTypeWhat it is
mapmapthe classes sieved
SettingTypeWhat it is
thresholdrequiredintegerthe fewest cells of a patch kept
neighboursinteger4 (default) or 8: the cells of a patch connected

raster.standardize#

A map (or every layer of a stack, or every map of a series) put on a common scale, for drivers and predictors compared or combined: the z-score ((x - mean) / std, the std of the population), min-max to 0-1, or the percentile stretch to 0-1 between two percentiles (the values beyond them 0 or 1). A layer of one value is all 0. The centre and scale of each layer in a table, to standardize other maps the same way (raster.calc).

InputTypeWhat it is
maprequiredanya map, a stack or a series of maps
OutputTypeWhat it is
mapanythe same, standardized: a map, a stack or a series
tabletablea row per layer (1..): center and scale, the value standardized (x - center) / scale
SettingTypeWhat it is
methodtextzscore (default), minmax or percentile
lownumberpercentile: the lower percentile (2)
highnumberpercentile: the upper percentile (98)

raster.stats#

A summary of a map, or of every layer of a stack or of a series of maps, as tables: the cells with a value (count) and without (nodata), the sum, mean, standard deviation, minimum, percentiles and maximum (the statistics of vector.zonal over the whole map), and a histogram of bins of equal width.

InputTypeWhat it is
maprequiredanya map, a stack or a series of maps
OutputTypeWhat it is
tabletablea row per layer (1.., in the stack's order): its statistics
histogramtablea row per layer and bin: layer, bin (1..), from, to, count and share of the cells with a value
SettingTypeWhat it is
statsanythe statistics: count, nodata, sum, mean, min, max, range, std, var, median, majority, minority, unique, percentile_

(default count, nodata, sum, mean, std, min, percentiles 5, 25, 50, 75, 95, max)

binsintegerthe histogram's bins (20)
rangeanythe histogram's [from, to] (default each layer's minimum and maximum); values outside left out

raster.tabulate#

The area of every class of a map in every zone of another, as ArcGIS's Tabulate Area or a cross tabulation: a row per zone, a column per class (class_) and the zone's total; in cells, in area (the map's units squared), in hectares (of a map in metres) or as each class's share of the zone. Cells without a zone or a class left out.

InputTypeWhat it is
zonesrequiredmapthe zone of every cell (its id)
classesrequiredmapthe class of every cell
OutputTypeWhat it is
tabletablezone, class_ for every class, total
SettingTypeWhat it is
unitstextcells (default), area, hectares or share

raster.terrain#

A measure of a surface such as an elevation model (gdaldem): slope (degrees, or percent with the option -p), aspect, hillshade, TRI (terrain ruggedness), TPI (topographic position) or roughness. For a surface in degrees of latitude and longitude, the option -s 111120 gives the slope in metres.

InputTypeWhat it is
rasterrequiredrasterthe surface
OutputTypeWhat it is
rasterrasterthe measure
SettingTypeWhat it is
measuretextslope (default), aspect, hillshade, TRI, TPI, roughness
optionstextmore of gdaldem's options, as on its command line
pathtextthe file (or folder, for a series) made; else a cache

raster.viewshed#

What can be seen from observers over an elevation map, as gdal_viewshed or GRASS's r.viewshed: a cell is seen when the line of sight from an observer's eye (the ground plus its height) to the cell (plus the target's height) passes above every cell between, traced along rays to the edge of each observer's reach (Franklin and Ray's R2); with curvature, the earth's curvature and refraction lowering the far cells (GDAL's coefficient, 0.85714). The map counts the observers seeing each cell (one observer: 1 seen, 0 not).

InputTypeWhat it is
maprequiredmapthe elevation (in the units of the map's coordinates)
pointsvectorthe observers (or x and y)
OutputTypeWhat it is
mapmaphow many observers see every cell
SettingTypeWhat it is
xnumberthe observer's x, without points
ynumberthe observer's y, without points
observer_heightnumberthe eye above the ground (2, as GDAL's)
target_heightnumberwhat is seen above the ground (0)
radiusnumberhow far an observer sees, in map units (the whole map)
curvatureboolthe earth's curvature and refraction (false)

raster.write#

Write a map, a stack (a band per map), the series of maps of a loop (a band per step) or rasters on disk (copied in blocks, whatever their size) to a GeoTIFF file, in the smallest type that holds the values unless one is given. With {name} in the file's name, a file per layer, {name} the layer's name (mspa/{name}_mspa.tif: forest_2010_mspa.tif, forest_2020_mspa.tif...). Maps of different grids (the files of a folder of tiles or regions, run one by one) make no file together: a file each, also without {name}, each one's name before the file's (mspa/mspa.tif: mspa/clc_r0c0_mspa.tif...).

InputTypeWhat it is
valuerequiredrastera map, a stack, a series of maps or rasters
OutputTypeWhat it is
pathtextthe file written (with {name}: a series of the files)
SettingTypeWhat it is
pathrequiredtextthe file, relative to the model's folder (.tif); {name} in it: a file per layer, named by it
typetextthe cell type: u8, i16, i32, f32, f64...
producttextthe product of GuidosToolbox the map is (MSPA, FAD...), written as landschaft_product: by default that of the operator that made it

raster.zonal#

Statistics of a map (or of every layer of a stack) in the zones of a map of zone ids (municipalities, watersheds, classes rasterized), as GRASS's r.univar by zones or terra's zonal: a row per zone, and a map of every cell given its zone's statistic (zonal statistics as a raster). The statistics of vector.zonal; the cells without a zone or without a value left out.

InputTypeWhat it is
maprequiredanya map, a stack or a series of maps
zonesrequiredmapthe zone of every cell (its id)
OutputTypeWhat it is
tabletablea row per zone (increasing): zone, then every statistic (of every layer: _)
mapmapevery cell given its zone's statistic to_map (of the first layer)
SettingTypeWhat it is
statsanycount, nodata, sum, mean, min, max, range, std, var, median, majority, minority, unique, percentile_

(default count, mean, min, max, std)

to_maptextthe statistic of the map (mean)

vector.buffer#

The area within a distance of every feature (GEOS through GDAL, as shapely's buffer): circles around points, corridors along lines, polygons grown (or shrunk, with a negative distance); the features' attributes kept, or every buffer merged into one (dissolve).

InputTypeWhat it is
vectorrequiredvectorthe features
OutputTypeWhat it is
vectorvectorthe buffers
SettingTypeWhat it is
distancerequirednumberthe distance, in the features' units
segmentsintegersegments of a quarter circle (16)
dissolveboolmerge the buffers into one feature (false)

vector.calc#

Attributes computed for every feature from a script over the others, as QGIS's field calculator, in map algebra's language (Python's syntax): the attributes by their names (the characters other than letters, digits and _ as _: individual-local-identifier as individual_local_identifier), numbers and texts ("high" if pop > 100 else "low"; uso == "forest"; float(code) reads a text as a number), the geometry's measures (geometry.area, geometry.perimeter, geometry.length, geometry.x, geometry.y), feature (the number 1..), x.sum() and the other methods over all the features, the node's other inputs (numbers and texts) by their names. One statement a line (# a comment): name = value, name[where] = value, and out name = value (or out name) for each attribute given; without out, the last value is the attribute column. An attribute of the same name is replaced, else it is added.

InputTypeWhat it is
vectorrequiredvectorthe features
OutputTypeWhat it is
vectorvectorthe features with the attributes
tabletabletheir attributes
SettingTypeWhat it is
columntextthe attribute's name (a script without out)
expressionrequiredtextits value, e.g. geometry.area / 10000; or a script: density = pop / geometry.area; out dense = density > 100

Takes any other inputs by name (any).

vector.clip#

Features cut to the area of a mask (the union of its polygons; GEOS through GDAL, as geopandas' clip): each feature's part inside it, those outside it left out, their attributes kept.

InputTypeWhat it is
vectorrequiredvectorthe features
maskrequiredvectorthe polygons they are cut to (reprojected to them)
OutputTypeWhat it is
vectorvectorthe features' parts inside the mask

vector.density#

The density of points on a map's grid, as ArcGIS's Kernel Density or QGIS's Heatmap: each point (its weight an attribute, or 1) spread by a kernel over a radius, the kernel's integral the weight, so the map is points per square map unit (or per hectare, per km²); quartic (biweight, the default, ArcGIS's), triweight, Epanechnikov, triangular or uniform; or the points in each cell counted (count; with a field, their sum). Without a radius ArcGIS's default (Silverman's rule). The points are reprojected to the map; distances in its units (a map in metres for densities per area).

InputTypeWhat it is
vectorrequiredvectorthe points
maprequiredmapa map on whose grid the density is made
OutputTypeWhat it is
mapmapthe density (or count) of every cell
SettingTypeWhat it is
kerneltextquartic (default), triweight, epanechnikov, triangular, uniform or count
radiusnumberthe kernel's radius in map units (Silverman's rule)
fieldtextthe attribute weighting each point (none: 1)
unitstextper square map unit (default), per hectare or per km²

vector.dissolve#

Features merged (GEOS's union through GDAL, as geopandas' dissolve): all into one, or one per value of an attribute (by), with that value and the features merged (count).

InputTypeWhat it is
vectorrequiredvectorthe features (of one kind: points, lines or polygons)
OutputTypeWhat it is
vectorvectorthe features merged
SettingTypeWhat it is
bytextthe attribute whose values are merged apart (none: all)

vector.distance#

The distance (in the map's units) from every cell's centre to the nearest cell of the features (as vector.rasterize burns them), exactly (the Euclidean distance transform). Out of core (block_rows, a path, or rasters on disk of more than 250 million cells) by strips into a GeoTIFF, the same distances (but where GDAL draws a line through cells' corners with all_touched).

InputTypeWhat it is
vectorrequiredvectorthe features
likerequiredrastera map on the grid of the distances (only its grid is read)
OutputTypeWhat it is
maprasterthe distance of every cell (0 in the features; on disk for rasters on disk)
SettingTypeWhat it is
all_touchedboolevery cell a feature touches is one (false)
block_rowsintegerout of core: by strips of this many rows into a GeoTIFF (path); on the grid of rasters on disk of more than 250 million cells always
pathtextout of core: the GeoTIFF written (default next to the rasters: name_distance.tif)

vector.exact_sum#

The coverage-weighted sum of a map (or of every layer of a stack) over every polygon, exactextractr's exact_extract(fun = "sum"): every cell weighted by the share of it the polygon covers, exactly (the amounts of features in planning units of polygons). Out of core (block_rows, or rasters on disk of more than 250 million cells) the windows under every polygon read from disk, the same sums.

InputTypeWhat it is
vectorrequiredvectorthe polygons
maprequiredanya map or a stack
OutputTypeWhat it is
tabletableper feature (1..): the sum of every layer
SettingTypeWhat it is
block_rowsintegerout of core: the values read under every polygon only, the same sums; rasters on disk of more than 250 million cells always are

vector.extract#

The values of a map (or of every layer of a stack) at points, landschaft's extract: the cell holding each point (nearest) or interpolated from the four nearest cell centres (bilinear, the weights over those with a value); with a buffer, the statistics of the cells within that radius of each point (zonal_stats of GEOS's circles). The points are reprojected to the map. No value outside it. Out of core (block_rows, or rasters on disk of more than 250 million cells) only the strips of rows holding points are read, the same values.

InputTypeWhat it is
vectorrequiredvectorthe points
maprequiredrastera map or a stack (or rasters on disk, by strips)
OutputTypeWhat it is
vectorvectorthe points with a column per layer (or statistic)
tabletableper point (feature 1..): its attributes and the values
SettingTypeWhat it is
methodtextnearest (default) or bilinear
buffernumbera radius (map units): statistics of the cells around
statsanywith a buffer: the statistics, as vector.zonal's
all_touchedboolwith a buffer: every cell the circle touches
block_rowsintegerout of core: the map read by strips of this many rows, the same values; rasters on disk of more than 250 million cells always are

vector.filter#

The features where an expression over their attributes is true, as QGIS's Select by Expression or geopandas' query, in map algebra's language (Python's syntax): the attributes by their names (the characters other than letters, digits and _ as _: individual-local-identifier as individual_local_identifier), numbers and texts (area > 10000 and uso == "forest"; float(code) reads a text as a number), the geometry's measures (geometry.area, geometry.perimeter, geometry.length, geometry.x, geometry.y), feature (the number 1..), the node's other inputs (numbers and texts) by their names. A script of several lines gives names values (density = pop / geometry.area) and ends with the condition. A feature where it is missing is left out.

InputTypeWhat it is
vectorrequiredvectorthe features
OutputTypeWhat it is
vectorvectorthe features kept
tabletabletheir attributes
SettingTypeWhat it is
expressionrequiredtextwhat a feature kept is, e.g. geometry.area > 10000 and uso == "forest" (a script: its last line)

Takes any other inputs by name (any).

vector.from_table#

Points from a table's columns of coordinates, as QGIS's Create Points Layer from Table or geopandas' points_from_xy: a point per row with an x and a y, the other columns its attributes, in the coordinate system given.

InputTypeWhat it is
tablerequiredtablethe table
OutputTypeWhat it is
vectorvectorthe points
tabletabletheir attributes
SettingTypeWhat it is
xtextthe column of the x (or longitude) (x)
ytextthe column of the y (or latitude) (y)
crstexttheir coordinate system: EPSG:4326, a WKT... (none: unknown)

vector.geometry#

The measures of every feature's geometry as attributes, as QGIS's Add Geometry Attributes: the area and perimeter of polygons (their holes left out of the area, their rings in the perimeter), the length of lines, and the centroid (x, y: of the area, the length or the points), in the features' units; with geodesic, the areas in square metres on the WGS84 ellipsoid (GDAL 3.9 or later).

InputTypeWhat it is
vectorrequiredvectorthe features
OutputTypeWhat it is
vectorvectorthe features with area, perimeter, length, x and y
tabletabletheir attributes
SettingTypeWhat it is
geodesicboolthe areas on the ellipsoid, in m² (false)

vector.grid_zones#

Square zones tiling a map, as landschaft's grid_zones: squares of a side (map units) from the map's top-left corner, partial squares at its right and bottom, row by row; for metrics.sample and metrics.series by zones.

InputTypeWhat it is
maprequiredrasterthe map tiled (only its grid is read)
OutputTypeWhat it is
zonesvectorthe squares, numbered (zone)
SettingTypeWhat it is
sizerequirednumberthe squares' side, in map units

vector.join#

A table's columns as attributes of features: every feature takes the row whose key column equals its attribute on (its number 1.. by default), e.g. the cluster of every zone of metrics.cluster on vector.grid_zones' squares (key zone); no value where no row matches. Attributes of the same name are replaced.

InputTypeWhat it is
vectorrequiredvectorthe features
tablerequiredtablethe table
OutputTypeWhat it is
vectorvectorthe features with the table's columns
SettingTypeWhat it is
ontextthe features' attribute (default their number, 1..)
keytextthe table's column (default zone, feature, plot_id or id if it has one, else its first)

vector.overlay#

Two layers of polygons overlaid, as geopandas' overlay or QGIS's Intersection, Union and Difference (GEOS through GDAL): the intersection (a polygon where a feature of each meets, with the attributes of both), the union (those, and the parts of each layer the other does not cover, with only their own attributes) or the difference (each feature of the first less the second's). The second layer is reprojected to the first's.

InputTypeWhat it is
vectorrequiredvectorthe first layer of polygons
otherrequiredvectorthe second layer of polygons
OutputTypeWhat it is
vectorvectorthe polygons overlaid
tabletabletheir attributes
SettingTypeWhat it is
howtextintersection (default), union or difference
suffixtextafter a name of the second layer the first has (_2)

vector.points#

Points inside polygons, as QGIS's Random Points Inside Polygons and Regular Points: random, n points in every polygon drawn uniformly over its area (numpy's generator of the seed); regular, the points of a grid of a spacing (from the polygons' lower left corner, half a spacing in) inside each. Each point with the number of its polygon (polygon) and the polygon's attributes.

InputTypeWhat it is
vectorrequiredvectorthe polygons
OutputTypeWhat it is
vectorvectorthe points
tabletabletheir attributes, x and y
SettingTypeWhat it is
methodtextrandom (default) or regular
nintegerrandom: the points in every polygon (10)
spacingnumberregular: the distance between points (map units)
seedintegerrandom: the generator's seed (1)

vector.polygonize#

A map of classes as polygons, as gdal_polygonize (GDALPolygonize): a polygon (with its holes) per patch, the connected cells of one value, its value, cells and area as attributes, in the order of their first cell; the cells without a value in none. The patches' cells joined by their sides (4) or also by their corners (8).

InputTypeWhat it is
maprequiredmapthe classes (or any values: a polygon per patch of one)
OutputTypeWhat it is
vectorvectorthe polygons: value, cells, area
tabletablethe feature (1..) and its value, cells and area
SettingTypeWhat it is
neighboursinteger4 (default, as GDAL's) or 8

vector.rasterize#

Burn vector features into the grid of a map, as GDAL's rasterizer (landschaft's rasterize): the cells whose centre a polygon takes (or every cell it touches), the cells of lines and of points; an attribute's value or one value; the later features over the earlier, or added up (counting overlaps). The features reprojected to the map's coordinate system first. Out of core (block_rows, a path, or rasters on disk of more than 250 million cells) burnt strip by strip into a GeoTIFF, the same cells (but where GDAL draws a line through cells' corners with all_touched).

InputTypeWhat it is
vectorrequiredvectorthe features
likerequiredrastera map on the grid to burn into (only its grid is read)
OutputTypeWhat it is
maprasterthe features burnt (on disk for rasters on disk)
SettingTypeWhat it is
fieldtextthe attribute burnt (features without it are left out)
valuenumberthe value burnt without a field (1)
fillnumberthe cells no feature takes (0; null: no value)
all_touchedboolevery cell a feature touches (false)
mergetextreplace (default: the last feature wins) or add
block_rowsintegerout of core: burnt by strips of this many rows into a GeoTIFF (path); on the grid of rasters on disk of more than 250 million cells always
pathtextout of core: the GeoTIFF written (default next to the rasters: name_burnt.tif)

vector.read#

Vector features from a file GDAL reads (GeoPackage, Shapefile, GeoJSON, FlatGeobuf, KML...): their geometries, attributes and coordinate system. A folder or a pattern (roads/*.gpkg): the features of every file in it as one layer, in the coordinate system of the first (the others' carried to it), with every attribute of any of them and file, the name of the file each feature comes from.

OutputTypeWhat it is
vectorvectorthe features
tabletablethe feature (1..) and its attributes that are numbers
SettingTypeWhat it is
pathrequiredtexta file, a folder or a pattern (their features as one layer), relative to the model's folder
layertextthe layer (default the first)

vector.reproject#

Features in another coordinate system, their coordinates transformed by PROJ through GDAL (as geopandas' to_crs): to an EPSG code, a WKT or a PROJ string, or to the coordinate system of a map or of other features (like).

InputTypeWhat it is
vectorrequiredvectorthe features
likeanya map or features whose coordinate system to take
OutputTypeWhat it is
vectorvectorthe features reprojected
tabletabletheir attributes
SettingTypeWhat it is
crstextthe coordinate system: EPSG:4326, a WKT...

vector.spatial_join#

The features of a layer joined to those of another where they meet, as geopandas' sjoin or QGIS's Join Attributes by Location (GEOS's intersects through GDAL): each feature takes the attributes of the first feature of the other layer it meets (attributes: the polygon holding a point), or the count of those it meets and the sum and mean of their attributes fields (summary: the points in every polygon counted). The other layer is reprojected to the first's.

InputTypeWhat it is
vectorrequiredvectorthe features joined to (points, or polygons counted)
otherrequiredvectorthe features joined (polygons, or points to count)
OutputTypeWhat it is
vectorvectorthe features with the other's attributes, or count, sums, means
tabletabletheir attributes
SettingTypeWhat it is
modetextattributes (default) or summary
fieldsanysummary: the other's attributes summed and averaged
suffixtextattributes: after a name the first layer has (_2)

vector.write#

Write vector features to a file by GDAL, its format by the extension (gpkg by default; shp, geojson, fgb, kml, gml).

InputTypeWhat it is
vectorrequiredvectorthe features
OutputTypeWhat it is
pathtextthe file written
SettingTypeWhat it is
pathrequiredtextthe file, relative to the model's folder
layertextthe layer's name (default the file's)

vector.zonal#

Statistics of a map (or of every layer of a stack) in every polygon, landschaft's zonal_stats: each polygon's cells as GDAL burns them (polygons may overlap), the cells with a value. Out of core (block_rows, or rasters on disk of more than 250 million cells) by strips of rows, the same values.

InputTypeWhat it is
vectorrequiredvectorthe polygons
maprequiredrastera map or a stack (or rasters on disk, by strips)
OutputTypeWhat it is
tabletableper feature (1..): every statistic (of every layer: _)
SettingTypeWhat it is
statsanycount, nodata, sum, mean, min, max, range, std, var, median, majority, minority, unique, percentile_

(default count, mean, min, max, std)

all_touchedboolevery cell a polygon touches (false)
block_rowsintegerout of core: the map read by strips of this many rows, the same values; rasters on disk of more than 250 million cells always are