Terraflux Terraflux
Download

Distance & restoration

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

distance.euclidean#

The Euclidean distance to the foreground's edge, as GuidosToolbox: in cells, positive inside the foreground and negative outside it, with GTB's byte map (130 + the distance inside, 130 - it outside, up to 120 cells) and the mean and largest distance on each side. The foreground is the classes given, or the map is coded 0 missing, 1 background, 2 foreground.

InputTypeWhat it is
maprequiredmapthe map
OutputTypeWhat it is
mapmapthe signed distance in cells
displaymapGTB's byte map of the distance
statstablethe foreground (1) and the background (0): their cells, mean and largest distance
SettingTypeWhat it is
foregroundanythe foreground's classes (a class or a list)

distance.influence_zones#

The zones of influence of the foreground objects, as GuidosToolbox's Distance -> Influence Zones (landschaft's influence_zones): the objects (8-connected, holes filled, of min_area cells at least, or their cores) and the watershed of the distance to them; a background buffer around them. Experimental in landschaft: IDL's distance transform is not yet reproduced exactly.

InputTypeWhat it is
maprequiredmapthe map
OutputTypeWhat it is
mapmapGTB's codes: objects, zones, lines, buffer, missing
idsmapthe object of every cell (holes included); 0 zones, -1 holes, -2 foreground of no object, -3 lines, -4 missing, -5 the buffer's edge, -6 buffer
zonesmapthe zone (watershed basin) of every cell, 0 on the lines
objectstableper object (1..): its area in cells (holes not counted)
SettingTypeWhat it is
bufferintegera background buffer this wide around the objects (0)
min_areaintegerthe least object, in cells (GTB's 5000)
core_bufferintegerthe objects reduced to their core first: this many cells of their edge dropped (0)
foregroundanythe foreground's classes (a class or a list)

distance.objects_proximity#

The proximity between neighbouring foreground objects, as GuidosToolbox's Distance -> Proximity (landschaft's proximity): the objects (8-connected, holes filled, of min_area cells at least) split the map into zones of influence (the watershed of the distance to them); along the zones' lines the gap between the objects and their connected area gain. Experimental in landschaft: IDL's distance transform is not yet reproduced exactly.

InputTypeWhat it is
maprequiredmapthe map
OutputTypeWhat it is
distancemapround(2 x the distance to the nearest object), the lines' updated
cagmapthe connected area gain on the lines
linestableper line cell: its column and row (1-based), the zones it touches, the connector length, the CAG, the first two objects and their areas
csvtextGTB's proximity CSV
mapmapGTB's codes: objects, zones, lines, buffer, missing
idsmapthe object of every cell (holes included); 0 zones, -1 holes, -2 foreground of no object, -3 lines, -4 missing, -5 the buffer's edge, -6 buffer
zonesmapthe zone (watershed basin) of every cell, 0 on the lines
objectstableper object (1..): its area in cells (holes not counted)
SettingTypeWhat it is
prox_maxintegerlines up to this proximity marked 165 (0)
min_areaintegerthe least object, in cells (GTB's 5000)
core_bufferintegerthe objects reduced to their core first: this many cells of their edge dropped (0)
foregroundanythe foreground's classes (a class or a list)

distance.proximity#

The distance from every cell to the nearest cell of some values (gdal_proximity), in the units of the raster or in cells: a driver such as the distance to roads, rivers or forest edges; done on the file, whatever its size.

InputTypeWhat it is
rasterrequiredrasterthe raster (its band chosen)
OutputTypeWhat it is
rasterrasterthe distances
SettingTypeWhat it is
valuesrequiredanythe values to measure from: a value or a list
unitstextgeo (default: the units of the raster) or cells
max_distancenumberbeyond it, no value
pathtextthe file (or folder, for a series) made; else a cache

restoration.corridor#

The gain of restoring the least-cost corridor between two areas, as GuidosToolbox's Restoration Planner (landschaft's restoration_corridor): the path's background cells turned habitat, the ECA and coherence before and after, and the gain per resistance restored.

InputTypeWhat it is
resistancerequiredmapthe resistance, 1-100 (0 or no value: impassable)
arequiredmaparea A: cells above 0
brequiredmaparea B: cells above 0
distancemapa distance (distance.euclidean), for the restored cells' mean
habitatrequiredmapthe habitat (0 missing, 1 background, 2 habitat)
OutputTypeWhat it is
pathmapthe path: 1, 0 elsewhere
restoredmapthe habitat with the corridor restored
statstablethe sizes of A and B, the cells restored, their mean distance, the expense, the efficiency (ECA gained per expense), ECA and coherence before, after and their gains

restoration.cost_distance#

The accumulated cost of travelling from the sources across a resistance, as GuidosToolbox (landschaft's cost_distance): 8 neighbours, a step the two cells' mean resistance times its length (1, or sqrt(2) diagonally).

InputTypeWhat it is
resistancerequiredmapthe resistance, 1-100 (0 or no value: impassable)
sourcesrequiredmapthe sources: cells above 0
OutputTypeWhat it is
mapmapthe cost (no value where the sources cannot be reached)

restoration.ecosystem_areas#

The ecosystems' (ecoregions') natural area now and before conversion and what restoring a cell gives them: restoration.plan's table and gain for the risk of ecosystem collapse. Every cell of an ecoregion counts (counting the problem's cells only would overstate the loss).

InputTypeWhat it is
land_coverrequiredstackthe share of each class, by name
ecoregionsrequiredmapecoregion codes (no value: none)
OutputTypeWhat it is
tabletableper ecoregion: its code, natural area (current), natural and anthropic (potential), cells, valid
gainstackper ecoregion: the area a unit of a cell restored gives it
SettingTypeWhat it is
naturalrequiredanythe natural classes
anthropicrequiredanythe anthropic classes
cell_areanumbera cell's area in km² (default: the grid's)

restoration.ecosystem_targets#

Share a restoration target among ecosystems for the least risk of collapse (the targets per ecosystem of Strassburg et al. 2020): every ecosystem between its least share and its converted area, for the most total of ((natural + share) / potential)^z, damped by exp(half_life x the ratio). exact: the optimum; steps: their stepwise procedure. The targets per region for restoration.plan (target: {code: area}).

InputTypeWhat it is
tablerequiredtablerestoration.ecosystem_areas's table
OutputTypeWhat it is
targetstableper ecosystem: its code (region) and its share (target)
SettingTypeWhat it is
targetrequirednumberthe area to share (km²)
minimumnumberevery ecosystem's least share, of an equal split (0)
znumberthe species-area exponent (0.25)
half_lifenumberthe damping exponent (0: none; below 1 - z)
methodtextexact (default) or steps
stepsintegersteps: the parts of the target (10)

restoration.intactness#

Ecological intactness (Beyer et al. 2020), as Strassburg et al. (2020) compute it: the habitat's quality q = exp(-gamma footprint) of a cell and of those around it (within radius cells, weighted by exp(beta distance in km)), Q = mean of (q q')^z. With a reduction and restored shares, the intactness after restoring them.

InputTypeWhat it is
footprintrequiredmapthe human footprint
reductionmapthe footprint a cell loses per unit restored
restoredmapthe share of each cell restored
OutputTypeWhat it is
mapmapthe intactness of each cell (0-1)
SettingTypeWhat it is
radiusintegerthe neighbourhood's radius in cells (default 3)
gammanumberthe footprint's decay of quality (default -ln(0.2)/4)
betanumberthe distance's decay per km (default -0.2)
znumberthe exponent of the pairs' quality (default 0.5)
cell_sizeanya cell's size in km, or [width, height] (default: the grid's, projected)

restoration.intactness_gradient#

How much the total ecological intactness grows per unit of each cell restored (its derivative): restoring a cell lowers its footprint by the reduction given per unit. With restored shares, at the footprint they leave.

InputTypeWhat it is
footprintrequiredmapthe human footprint
reductionrequiredmapthe footprint a cell loses per unit restored
restoredmapthe share of each cell restored already
OutputTypeWhat it is
mapmapd(total intactness) / d(share restored) of each cell
SettingTypeWhat it is
radiusintegerthe neighbourhood's radius in cells (default 3)
gammanumberthe footprint's decay of quality (default -ln(0.2)/4)
betanumberthe distance's decay per km (default -0.2)
znumberthe exponent of the pairs' quality (default 0.5)
cell_sizeanya cell's size in km, or [width, height] (default: the grid's, projected)

restoration.isochrone#

The isochrone map of GuidosToolbox's Restoration Planner (landschaft's isochrone_map and isochrone_map_ab, GTB's ggeo): the accumulated cost of reaching every cell from object A across a resistance (a step between neighbours their mean resistance, the habitat 1), or with an object B the cost of the cheapest route from A to B through every cell and its least-cost path; scaled 0-100 in GTB's codes.

InputTypeWhat it is
resistancerequiredmapthe resistance: 2 habitat (cost 1), 3-100 background
markerrequiredmap0 background, 1 object A, 2 object B (the route A-B), 3 missing (not crossed); one object each
OutputTypeWhat it is
mapmapGTB's codes: the cost scaled 0-100, 101 the objects, 102 missing, 103 the least-cost path, 104 unreachable
costmapthe cost as GTB rounds it (no value where unreachable)
pathmapA-B: the least-cost path (1)
statstablethe least and the largest cost

restoration.least_cost_path#

The least-cost path between two areas across a resistance, as GuidosToolbox (landschaft's least_cost_path): the cells of the least cost from A plus from B.

InputTypeWhat it is
resistancerequiredmapthe resistance, 1-100 (0 or no value: impassable)
arequiredmaparea A: cells above 0
brequiredmaparea B: cells above 0
distancemapa distance (distance.euclidean), for the restored cells' mean
OutputTypeWhat it is
pathmapthe path: 1, 0 elsewhere
costmapthe cost from A plus the cost from B
statstablethe path's length, its cells in the background, their resistance (the expense) and mean distance

restoration.original_vegetation#

The original vegetation of converted land (Strassburg et al. 2020): for every cell with anthropic land, the shares of the natural classes it had, from the past cover where it tells, else from the ecoregion's natural shares, else from failsafe shares (the mean over the map); and the shares restored land returns to. The land cover is a stack of each class's share (0-1).

InputTypeWhat it is
land_coverrequiredstackthe share of each class, by name
paststackthe past share of each natural class
ecoregionsstackthe ecoregion's share of each natural class
OutputTypeWhat it is
originalstackthe original share of each natural class
restorestackthe shares of the natural classes restored land returns to
sourcemapwhere the original came from: 0 past, 1 ecoregion, 2 failsafe
anthropicmapthe share of anthropic land
failsafetablethe failsafe share of each class filled (in natural's order)
SettingTypeWhat it is
naturalrequiredanythe natural classes (names of the land cover's layers)
anthropicrequiredanythe anthropic classes
failsafeanythe natural classes the failsafe fills (default all)
thresholdnumberthe share of land a source must explain (default 0.95)
restore_totextoriginal (default) or current: restored land returns to the current natural cover where it has some

restoration.plan#

Restoration planning (Strassburg et al. 2020): how much of every converted cell to restore for the most benefit within area targets and a budget: the reduction of the species' extinction risk (the species-area relationship on their area of habitat, sdm.area_of_habitat's table and gain) and linear benefits (carbon per km²). exact: the optimum within a tolerance (simplicial decomposition with a proven bound); steps: Strassburg et al.'s procedure (the target in steps, the benefits recomputed between them); uniform: every cell by the same share.

InputTypeWhat it is
restorablemapthe share of every cell that can be restored (anthropic land)
conservablemapthe share of every cell's natural land conservation can keep (C): without the plan, threat of it is lost
convertiblemapthe share of every cell's natural land that can be converted (D; with restorable, R + D)
threatmapconservation: the share of the conservable land lost without it (1)
lossstacksdm.area_of_habitat's loss (conservation, conversion)
tabletablesdm.area_of_habitat's table: current, potential, valid
gainstacksdm.area_of_habitat's gain: habitat per unit of a cell restored
linearstacklinear benefits per km² restored (carbon...), a layer each
costmapthe cost per km² restored (with budget)
regionsmapregion codes, for targets per region
limitmapthe bound limit: a share per cell multiplying the restorable
hfimapthe human footprint, for the intactness benefit
reductionmapintactness: the footprint a cell loses per unit restored
increasemapintactness: the footprint a cell gains per unit of natural land converted (or lost unconserved)
OutputTypeWhat it is
restoredmapthe share of every cell restored
conservedmapthe share of every cell's natural land conserved
convertedmapthe share of every cell's natural land converted
summarytablethe weighted benefit, the area (km²), the cost, the bound (exact), optimal (1), the rounds, the extinction risk's reduction and its standard deviation
tradeofftablewith levels: per level its share, the landscape target, the area and the weighted benefit
gradientmapwith levels: the levels whose plan acts on the cell (conversion: the levels plus one less that)
benefitstableper benefit (the risk, the linear ones, intactness): value, weight, weighted
weightstablewith weights: per set the weights (w.), the benefits, the cost, and Strassburg et al.'s mean, sd, score and rank
speciestableper species counted (its row in the area of habitat's table): the habitat gained, the risk without and with the plan, the reduction
SettingTypeWhat it is
methodtextexact (default), steps or uniform
levelsanya trade-off curve: the landscape target's shares at every level (increasing, in (0, 1])
nestedboolexact trade-offs: every level contains the previous (true)
thresholdnumberthe gradient: a cell counts when its share is above (0)
projected_changeanyprojected changes of natural land per region ({code: km²}; + spared for restoration, - demanded)
change_sensetextthe projected changes' rows (= default)
restrictboolrestore and convert: every region in its direction only (true)
compensateboolrestore only: the land demanded elsewhere taken from it (true)
stepsintegersteps: the parts of the target (default 1)
targetanythe area restored (km²): a number for the landscape, or {region code: area} with regions
sensetextthe targets' sense: <= (default, at most), >=, =
relativeboolthe targets are shares of the area that can be restored
budgetnumberthe most the plan may cost (with cost)
zanythe species-area exponent: a number (0.25) or one per species
weightnumberthe risk benefit's weight (1)
linear_weightsanythe linear benefits' weights (1 each)
restoration_discountanythe share of the habitat value restored land does not deliver (0; one or one per species)
cell_areanumbera cell's area in km² (default: the grid's)
z_sdanythe standard deviation of z (0.1 in Strassburg et al. 2020; one or one per species counted): the risk reduction's
uncertaintytexthow the species' sensitivities to z add up: correlated (default), independent or linear (Strassburg et al.'s)
intactness_weightnumberthe intactness benefit's weight (1; with hfi)
intactness_formtextlinear (default: its gradient at the plan of nothing, recomputed between steps) or exact (the total intactness)
radiusintegerintactness: the neighbourhood's radius in cells (3)
gammanumberintactness: the footprint's decay of quality (-ln(0.2)/4)
betanumberintactness: the distance's decay per km (-0.2)
intactness_znumberintactness: the exponent of the pairs' quality (0.5)
cell_sizeanyintactness: a cell's size in km, or [width, height] (default: the grid's, projected)
min_benefitnumberthe cheapest plan whose weighted benefit reaches this (with cost; exact)
weightsanysets of weights to compare ([{benefit: weight}]; the benefits extinction_risk, the linear layers' names, intactness): the plan of the best ranked
tolerancenumberexact: the relative gap to the bound (1e-7)
time_limitnumberexact: seconds (default none)

restoration.resistance#

A resistance growing with the distance to the habitat, as GuidosToolbox's Setup Tools -> Distance -> Resistance (landschaft's distance_to_resistance): the background round(distance + 2) up to 100 (3 next to the habitat), the habitat 2, missing 0; IDL's quasi-Euclidean distance.

InputTypeWhat it is
maprequiredmapthe map (0 missing, 1 background, 2 habitat)
OutputTypeWhat it is
mapmapthe resistance
SettingTypeWhat it is
foregroundanythe foreground's classes (a class or a list)

restoration.status#

How connected the habitat is and how much reconnecting it could add, as GuidosToolbox's Restoration Status (landschaft's restoration_status): the habitat's objects (8-connected), the equivalent connected area ECA = sqrt(sum of their areas squared), the coherence ECA / habitat (%), the restoration potential (100 - coherence), the habitat's share of the area with data (RAC), the average patch size and the critical new object area.

InputTypeWhat it is
maprequiredmapthe habitat map (0 missing, 1 background, 2 habitat)
OutputTypeWhat it is
statstablethe area with data, objects, habitat, largest object, APS, CNOA, ECA, coherence (%), restoration potential (%), RAC (%)
SettingTypeWhat it is
foregroundanythe foreground's classes (a class or a list)