Terraflux Terraflux
Download

Spatial prioritization

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

prioritize.actions#

Multi-action planning as a mixed integer program (Salgado-Rojas et al. 2020): which planning units to monitor and which actions against which threats to take in them, so that the features recover (or are kept) to their targets at the least cost (minimizeCosts), or recover the most within a budget (maximizeBenefits); the boundary of the units and of every threat's actions weighed; linear, quadratic or cubic responses. The model of Salgado-Rojas et al. with its checks and defaults, solved by landschaft's closure engine and HiGHS.

InputTypeWhat it is
purequiredtableplanning units: id, monitoring_cost, status (0, 2 locked in, 3 out)
featuresrequiredtableid, target_recovery, target_conservation (0)
dist_featuresrequiredtablethe features' amounts: pu, feature, amount
threatsrequiredtableid, blm_actions (the weight of its actions' boundary; 0)
dist_threatsrequiredtablethe threats in the units and the actions against them: pu, threat, amount, action_cost, status
sensitivitytablewhich features each threat harms: feature, threat, delta1-delta4 (default every feature to every threat)
boundarytableid1, id2, boundary (shared lengths)
OutputTypeWhat it is
monitoringtableid and solution of every planning unit
actionstablepu, threat and solution of every action
summarytableper unit: its actions by threat, conservation (a feature kept without actions), connectivity (monitored for neither): getActions()
resulttablethe objective, the solver's gap and status (1 optimal)
costtablethe monitoring cost and every threat's actions' cost
benefittableevery feature's benefit: conservation, recovery, total
localtableevery (unit, feature)'s benefit
potentialtableevery feature's distribution and the most benefit
connectivitytablewith boundary data: the boundary of the monitored units and of every threat's actions
SettingTypeWhat it is
modeltextminimizeCosts (default) or maximizeBenefits
budgetnumbermaximizeBenefits: the most the units and actions may cost
blmnumberthe weight of the monitored units' boundary (0)
curveintegerthe features' response: 1 linear (default), 2, 3
segmentsintegercurve 2, 3: pieces of its linear approximation (3)
gapnumberthe relative optimality gap (default 0)
time_limitnumberseconds (default none)

prioritize.actions_raster#

Multi-action planning on rasters (landschaft's actions_raster_data): the planning units are the cells with a monitoring cost, a layer per feature its amounts and per threat its intensity (> 0 where it occurs; the action there removes it), the actions' costs numbers or maps; the tables of prioritize.actions built as landschaft builds them (relative targets shares of what each feature has where a threat harms it and where none does), solved as prioritize.actions solves them, the monitored cells and every threat's actions as maps.

InputTypeWhat it is
monitoring_costrequiredmapthe cost of monitoring every cell (no value: not a unit)
featuresrequiredstackthe features' amounts, a layer each (no value 0)
threatsrequiredstackthe threats' intensities, a layer each (> 0 where it occurs)
mapsstackthe maps of the actions' costs, named in action_cost
locked_inmapcells that must be monitored (not 0)
locked_outmapcells that must not be monitored (not 0)
sensitivitytablewhich features each threat harms: feature, threat (1-based, in the layers' order), delta1-delta4 (default every feature to every threat)
OutputTypeWhat it is
mapsstackthe monitored cells (monitoring) and every threat's actions (by its name), 0/1
putablethe planning units built: id, monitoring_cost, status
dist_threatstablethe actions built: pu, threat, amount, action_cost
monitoringtableid and solution of every planning unit
actionstablepu, threat and solution of every action
summarytableper unit: its actions by threat, conservation (a feature kept without actions), connectivity (monitored for neither): getActions()
resulttablethe objective, the solver's gap and status (1 optimal)
costtablethe monitoring cost and every threat's actions' cost
benefittableevery feature's benefit: conservation, recovery, total
localtableevery (unit, feature)'s benefit
potentialtableevery feature's distribution and the most benefit
connectivitytablewith boundary data: the boundary of the monitored units and of every threat's actions
SettingTypeWhat it is
action_costanythe cost of acting against every threat: a number or a map's name (one of maps) for all, a list in the threats' order or {threat: ...} (default 1)
target_recoveryanythe features' recovery targets: a number, a list in the features' order or {feature: ...}
target_conservationanythe features' conservation targets, the same
relativeboolthe targets are shares (0-1) of the feature where threats harm it (recovery) or none does (conservation); default true
blm_actionsanythe weight of every threat's actions' boundary (0)
boundaryboolthe cells' shared edges as boundary data (for the blms)
modeltextminimizeCosts (default) or maximizeBenefits
budgetnumbermaximizeBenefits: the most the units and actions may cost
blmnumberthe weight of the monitored units' boundary (0)
curveintegerthe features' response: 1 linear (default), 2, 3
segmentsintegercurve 2, 3: pieces of its linear approximation (3)
gapnumberthe relative optimality gap (default 0)
time_limitnumberseconds (default none)

prioritize.adjacency_matrix#

1 for every two adjacent planning units (landschaft's adjacency_matrix): cells with data sharing an edge (4 directions) or a corner too (8); polygons that meet.

InputTypeWhat it is
unitsrequiredanythe planning units: a map or a stack (cells), or polygons
OutputTypeWhat it is
tabletablei, j, x: the units (1..) and their value
SettingTypeWhat it is
directionsinteger4 (default) or 8, for rasters

prioritize.binary_stack#

A 0/1 layer per zone from a map of zone numbers (landschaft's binary_stack), for the locked-in constraints of zones (an existing zoning plan); cells with 0 are in no zone, missing ones stay missing.

InputTypeWhat it is
zonesrequiredmapzone numbers 1, 2... (0: none)
OutputTypeWhat it is
stackstacka layer per zone, by name
SettingTypeWhat it is
namesanythe zones' names in the order of their numbers (default 1, 2...)

prioritize.boundary_matrix#

The length of the boundary every two planning units share, and every unit's perimeter on the diagonal (landschaft's boundary_matrix): raster cells with data share xres with those above and below and yres with those left and right; polygons their common paths, rounded to 8 decimals.

InputTypeWhat it is
unitsrequiredanythe planning units: a map or a stack (cells), or polygons
OutputTypeWhat it is
tabletablei, j, x: the units (1..) and their value

prioritize.calibrate#

The calibration of trade-offs (Hanson et al. 2025): candidate solutions of a problem (given as to prioritize.optimize, without the penalty traded off) over a trade-off parameter. blended: the problem with a range of penalty weights (default 9 over 1/100 to 100 times Cohon et al.'s penalty); hierarchical: the least penalty within cost thresholds above the least cost solution's; pareto: the least total shortfall of the targets within budgets; cohon: the penalty of Cohon et al. (1979) from the two ideal solutions. Every candidate's cost and criterion (boundary, connectivity, linear penalty or shortfall), and the candidates TOPSIS and the knee of the curve choose. The solves run in parallel.

InputTypeWhat it is
featuresstackthe features' amounts, a layer each
costmapthe cost of each cell (no value: not a planning unit)
polygonsvectorplanning units of polygons (with cost_column; with zones, one per zone): the features' amounts summed over them exactly (exactextract), their shared boundaries and adjacency from the geometries
putabletables instead of maps: as prioritize.optimize's
spectableMarxan-style: the features (id)
rijtableMarxan-style: the amounts (pu, species, amount)
locked_inmapthe units that must be selected (not 0)
locked_outmapthe units that may not be selected (not 0)
targetstabletargets by hand, as prioritize.optimize's
boundary_datatablea boundary matrix of every unit: i, j, x (1-based)
connectivity_datatablea symmetric connectivity matrix: i, j, x
asym_connectivity_datatablea connectivity matrix: i, j, x
adjacency_datatablean adjacency matrix of every unit: i, j, x
penalty_datamapthe linear penalty: a value per cell
constraint_datamapa linear constraint: a value per cell
boundstablemanual bounds, as prioritize.optimize's
statustablemanual locked units, as prioritize.optimize's
OutputTypeWhat it is
tabletableper candidate: value (the penalty, cost threshold or budget), cost, the criterion (boundary, connectivity, asym_connectivity, linear or shortfall; pareto: met, the targets met), objective, optimal (1), gap, topsis_score, topsis and knee (1: chosen; pareto: efficient). cohon: the two ideal solutions' cost and criterion and the penalty
selectiontableper unit: its cell or row (1..) and every candidate's share
solutionsstackmaps: every candidate, a layer each
bestmapmaps: the candidate TOPSIS chooses
SettingTypeWhat it is
approachtextblended (default), hierarchical, pareto or cohon
penaltytextthe penalty traded off against the cost: boundary (default), connectivity, asym_connectivity, linear
valuesanythe candidates: blended's penalties, hierarchical's cost thresholds, pareto's budgets
nintegerthe candidates without values (blended 9, pareto 10)
inflationanyhierarchical without values: the thresholds the least cost x (1 + these), rounded up (1e-5 to 4)
objectivetextthe problem's objective (min_set; pareto: any with targets)
relative_targetsanyas prioritize.optimize's
absolute_targetsanyas prioritize.optimize's
loglinear_targetsanyas prioritize.optimize's
feature_weightsanyas prioritize.optimize's
decisionstextas prioritize.optimize's
edge_factornumberthe boundary: the weight of edges to no unit (0.5)
cost_columntexttables: as prioritize.optimize's
featuresanytables: as prioritize.optimize's
penalty_columntexttables: pu's column of the linear penalty
spatialanyother penalties and constraints, as prioritize.optimize's
gapnumberthe candidates' optimality gap (default 0.1)
ideal_gapnumberthe least cost and Cohon's ideal solutions' gap (0)
time_limitnumberseconds per solve (default none: a strong penalty can make a solve take hours; the candidates stopped by it are marked not optimal, with their gap)

prioritize.coarsen#

A problem's rasters on blocks of factor x factor cells (landschaft's coarsen, for continental problems: solve the coarse problem, then prioritize.refine the selection): every block's cost and amounts the sums of its cells with a cost (a block without any has none).

InputTypeWhat it is
costrequiredmapthe cost of the planning units
featuresrequiredanythe features' amounts: a stack or a map
OutputTypeWhat it is
costmapthe cost of the blocks
featuresstackthe amounts of the blocks
SettingTypeWhat it is
factorrequiredintegercells per side of a block

prioritize.connectivity_matrix#

The connectivity of adjacent planning units (landschaft's connectivity_matrix): the length of their shared boundary times the mean of y in the two (a map on the units' grid; for polygons a map averaged over each, exactextract's, or an attribute).

InputTypeWhat it is
unitsrequiredanythe planning units: a map or a stack (cells), or polygons
ymapthe map of y
OutputTypeWhat it is
tabletablei, j, x: the units (1..) and their value
SettingTypeWhat it is
columntextfor polygons: the attribute of y

prioritize.decay_connectivity#

Connectivity from the distances between planning units as a dispersal probability (landschaft's decay_connectivity, Conefor's negative exponential): exp(-ln 2 d / median), 0.5 at the median dispersal distance, left out below a probability, 0 on the diagonal and for pairs out of reach. The distances from cost.distance, cost.commute_distance or circuits between unit points.

InputTypeWhat it is
distancesrequiredtablea row per unit (its number first, or not), a column per unit
OutputTypeWhat it is
tabletablei, j, x: the probabilities kept (connectivity_data)
SettingTypeWhat it is
medianrequirednumberthe median dispersal distance
min_probabilitynumberthe least kept (default 0.001)

prioritize.evaluate#

The evaluation of a solution (Hanson et al. 2025): the units selected, their cost and boundary; how much of each feature it holds; with targets, their coverage and Ferrier et al.'s irreplaceability of the units selected; the rarity-weighted richness of the units selected. The problem is given as to prioritize.optimize (maps or tables), the solution as a map or as prioritize.optimize's selection; the connectivity of the solution with connectivity matrices.

InputTypeWhat it is
featuresstackthe features' amounts, a layer each
costmapthe cost of each cell (no value: not a planning unit)
polygonsvectorplanning units of polygons (with cost_column; with zones, one per zone): the features' amounts summed over them exactly (exactextract), their shared boundaries and adjacency from the geometries
putabletables instead of maps: as prioritize.optimize's
spectableMarxan-style: the features (id)
rijtableMarxan-style: the amounts (pu, species, amount)
solutionmapthe share of each unit selected
zone_costsstackzones: as prioritize.optimize's
zone_featuresstackzones: as prioritize.optimize's
contribution_mapsstackzones: as prioritize.optimize's
zone_solutionstackzones: the share of each unit in every zone, a layer per zone (or the selection: solution_)
selectiontablethe solution as a table: prioritize.optimize's selection (unit, solution), or a column (solution, solution_1 or the only one) with a row per unit
targetstabletargets by hand, as prioritize.optimize's
boundary_datatablea boundary matrix of every unit: i, j, x (1-based)
connectivity_datatablea symmetric connectivity matrix: i, j, x
asym_connectivity_datatablea connectivity matrix: i, j, x
OutputTypeWhat it is
summarytablethe units selected (n), their cost and boundary (no value: tables without a boundary matrix), and with the matrices their connectivity and asym_connectivity
representationtableper feature: its total, the amount held and its share
coveragetableper target: its feature, met (1), the total, the target, the amount held and the shortfall, and these relative to the total
unitstableper unit: its cell or row (1..), the solution, the rarity-weighted richness, Ferrier's (ferrier_, ferrier_total), the replacement cost and the rank importance when asked
ferrierstackmaps: Ferrier's irreplaceability per feature and in total
raritymapmaps: the rarity-weighted richness of the units selected
replacementmapmaps: each selected unit's replacement cost
rankmapmaps: each selected unit's rank importance
rank_budgetstablerank: the budgets and the objective at each
extinction_risktablewith extinction_z: per feature its share held, z and risk 1 - share^z; their sum last
SettingTypeWhat it is
relative_targetsanya share of each feature's total (or one for all)
absolute_targetsanyan amount per feature
loglinear_targetsanyas prioritize.optimize's
edge_factoranythe boundary: the weight of edges to no unit (0.5; zones: one or one per zone)
boundary_zonesanyzones: the boundary's zones matrix (default the identity)
connectivity_zonesanyzones: the connectivity's zones matrix
asym_connectivity_zonesanyzones: the asymmetric connectivity's
manual_targetsanytargets by hand with their zones, as prioritize.optimize's
feature_namesanyzones: the features' names
contributionanyzones: as prioritize.optimize's
rescaleboolthe importances rescaled to 0.01-1 (default true)
replacementboolthe replacement cost of every unit selected (a solve without each)
rankintegerthe rank importance with this many budgets
budgetsanythe rank importance at these budgets
objectivetextthe problem's objective (as prioritize.optimize's)
budgetnumberthe objective's budget
gapnumberthe solves' optimality gap (default 0.1)
extinction_zanythe features' extinction risk by the species-area relationship with this z (one or per feature)

prioritize.h3_units#

H3 hexagons as planning units, as landschaft's h3_units: the hexagons of an H3 resolution that cover a cost map (its footprint in longitude and latitude, every hexagon that overlaps it), in the map's coordinate system, those over cells with a cost, each with the sum of the costs of the cells it covers weighted by the exact share of each cell inside it. For prioritize.optimize as polygons (cost_column cost).

InputTypeWhat it is
costrequiredmapthe cost map (with a coordinate system)
OutputTypeWhat it is
unitsvectorthe hexagons: h3 (the cell's index) and cost
tabletableper hexagon (unit 1..): its cost
SettingTypeWhat it is
resolutionrequiredintegerH3's resolution, 0 to 15 (7 about 5 km², 8 about 0.7 km², 9 about 0.1 km²)

prioritize.marxan#

Marxan 4: reserves that meet the features' targets at the least cost and boundary, by simulated annealing and iterative improvement, a number of runs; the same runs as the Marxan program. From Marxan's tables (pu: id, cost, status; spec: id, target, prop, spf, targetocc; puvspr: species, pu, amount; bound: id1, id2, boundary), or from maps: every cell with a cost a planning unit, the features' layers its amounts, its shared edges its boundaries.

InputTypeWhat it is
putablethe planning units: id, cost, status (0-3)
spectablethe features: id, target, prop, spf, targetocc
puvsprtablethe amounts: species, pu, amount
boundtablethe boundaries: id1, id2, boundary
featuresstackmaps instead of tables: the features' amounts
costmapmaps: the cost of each cell (no value: no unit)
statusmapmaps: 0 available, 1 in at first, 2 locked in, 3 out
OutputTypeWhat it is
besttablethe best run's reserve: pu, solution (1 in)
solutionstableevery run's reserve: pu, then a column per run (1 in)
frequencytablehow often each unit was selected: pu, frequency (0-1)
summarytableper run: its score, cost, units, boundary, penalty, shortfall, features missed, least proportion met and final score
penaltiestableper feature: its id, target and penalty
mapmapmaps: the best run's reserve (1 in, 0 out)
frequency_mapmapmaps: how often each cell was selected
SettingTypeWhat it is
blmnumberthe boundary length modifier (default 0)
propanyMarxan's PROP: every feature's target as a share of its total; maps: a list, a share per feature
targetsanymaps: the features' targets (amounts)
spfanymaps: the features' penalty factors (default Marxan's)
edge_factornumbermaps: the weight of the edges to no unit (default 1)
num_repsintegerruns (default 10)
num_itersintegerannealing's iterations (default 1000000)
start_tempnumberthe starting temperature (-1: adaptive, default)
cool_facnumberthe cooling factor (default 0)
num_tempintegertemperature decreases (default 10000)
run_modeintegerMarxan's run mode (default 1)
heur_typeintegerthe heuristic (default 1)
itimp_typeintegerthe iterative improvement (default 0)
misslevelnumberthe share of a target that counts as met (1)
cost_threshnumberthe cost threshold (default 0: none)
thresh_pen1numberthe cost threshold's penalty a
thresh_pen2numberthe cost threshold's penalty b
connectivity_inboolboundaries within the reserve count
seedintegerthe random seed (default 1)

prioritize.optimize#

Systematic conservation planning as an integer linear program (Beyer et al. 2016; Hanson et al. 2025): a decision per planning unit (the cells with a cost), solved to optimality (within the gap) by HiGHS. Objectives: min_set (meet every target at the least cost), min_shortfall, min_largest_shortfall, max_utility, max_features, max_cover, min_penalties, max_phylo_div, max_phylo_end (with a budget); targets relative, absolute, loglinear or by hand; feature weights; binary, proportion or semicontinuous decisions; locked units; boundary, connectivity and linear penalties, linear constraints, neighbour and contiguity constraints; planning units in maps or tables; portfolios of solutions.

InputTypeWhat it is
featuresstackthe features' amounts, a layer each
costmapthe cost of each cell (no value: not a planning unit)
polygonsvectorplanning units of polygons (with cost_column; with zones, one per zone): the features' amounts summed over them exactly (exactextract), their shared boundaries and adjacency from the geometries
zone_costsstackmanagement zones: the cost of every cell in every zone, a layer per zone named by it (no value: the cell cannot go to the zone)
zone_featuresstackzones: every zone's own features, zone after zone; else features and contribution
contribution_mapsstackzones: a contribution raster per zone, named by it
zone_locked_instackzones: the units locked into every zone, a layer each
zone_locked_outstackzones: the units locked out of every zone
zone_penalty_datastackzones: linear penalties, a layer per zone
zone_constraint_datastackzones: a linear constraint, a layer per zone
putabletables instead of maps: the planning units, a row each (a cost column, the features' columns)
spectableMarxan-style: the features (id)
rijtableMarxan-style: the amounts (pu, species, amount)
boundary_datatablea boundary matrix of every unit: i, j, x (1-based)
connectivity_datatablea symmetric connectivity matrix: i, j, x
asym_connectivity_datatablea connectivity matrix: i, j, x
adjacency_datatablean adjacency matrix of every unit: i, j, x
locked_inmapthe units that must be selected (not 0)
locked_outmapthe units that may not be selected (not 0)
targetstabletargets by hand: feature (1..), relative (1) or absolute (0), sense (1 >=, -1 <=, 0 =), target
boundstablemanual bounds: pu (the cell or row, 1..), lower and upper (a unit listed again: its last bounds)
statustablemanual locked units: pu and status (1 in, 0 out; a share with proportion decisions), after bounds
penalty_datamaplinear penalties: a value per cell
constraint_datamapthe linear constraint: a value per cell
OutputTypeWhat it is
solutionmapmaps: the share of each unit selected (1 selected); zones: the zone of each unit (1.., 0 none)
allocationstackmaps with zones: the share of each zone, a layer each
selectiontableper unit: its cell or row (1..) and the share selected (a portfolio: solution_1.., frequency)
summarytablethe solution's objective, cost, units selected, the solver's gap and status (1 optimal); a row per solution of a portfolio
solutionsstackmaps, a portfolio: every solution, a layer each
frequencymapmaps, a portfolio: the share of the solutions selecting a unit
coveragetableper target: its feature, the amount held, the target, the feature's total, and whether it is met (of the first solution)
extinction_risktablemin_extinction_risk: per feature its share held, z and species-area risk; their sum last
SettingTypeWhat it is
objectivetextmin_set (default), min_shortfall, min_largest_shortfall, max_utility, max_features, max_cover, min_penalties, max_phylo_div, max_phylo_end, min_extinction_risk (landschaft's: the least sum of the features' species-area risk 1 - (held / total)^z within the budget)
zanymin_extinction_risk: the species-area exponent, one or one per feature, in (0, 1] (0.25)
segmentsintegermin_extinction_risk: the pieces of the linear risk curve (16; exact at their ends)
budgetanythe objectives with a budget: the cost they may spend (with zones: one, or one per zone)
manual_targetsany[{feature, zone (a name or names; default every zone), type: relative|absolute, sense, target}, ...]
contributionanyzones: every zone's share of the features ({zone: a number, one per feature, or tables: a column})
feature_namesanyzones: the features' names
zonesanytables with zones: the zones' names, or Marxan's [{id, name}, ...]
boundary_zonesanyzones: how much a boundary counts between two zones (zones x zones; default the identity); likewise connectivity_zones, asym_connectivity_zones, neighbors_zones (0/1) and contiguity_zones (0/1), or zones in a spatial item
connectivity_zonesanyzones: as boundary_zones
asym_connectivity_zonesanyzones: as boundary_zones (not symmetric)
neighbors_zonesanyzones: the zones whose units count as neighbours
contiguity_zonesanyzones: the zones whose units form one patch together
mandatory_allocationboolzones: every planning unit goes to a zone (add_mandatory_allocation_constraints)
treetextmax_phylo_div, max_phylo_end: the phylogeny in Newick, its tips the features (with branch lengths)
relative_targetsanya share of each feature's total (or one for all)
absolute_targetsanyan amount per feature
loglinear_targetsany[lower amount, lower target, upper amount, upper target(, cap amount, cap target)]
feature_weightsanya weight per feature
decisionstextbinary (default), proportion or semicontinuous
upper_limitnumbersemicontinuous: the most of a unit selected
boundary_penaltynumberboundary penalties: the weight of the selection's boundary (its exposed edges times edge_factor)
edge_factornumberboundary penalties: the weight of edges to no unit (0.5)
linear_penaltynumberlinear penalties: the weight of penalty_data
linear_thresholdnumbera linear constraint on constraint_data
linear_sensetextthe linear constraint's sense: <= (default), >=, =
neighborsnumberevery selected unit has this many selected neighbours
clampboolneighbors: fewer for the units with fewer (default true)
contiguityboolthe selected units form one patch (adjacent: the raster's 4 neighbours, or adjacency_data)
feature_contiguityboolevery feature's units form one patch
cost_columntexttables: pu's cost column (default cost)
featuresanytables: pu's feature columns
locked_in_columntexttables: pu's column of the units locked in
locked_out_columntexttables: pu's column of the units locked out
connectivity_penaltynumberconnectivity penalties' weight
asym_connectivity_penaltynumberasymmetric connectivity's weight
penalty_columntexttables: pu's column of the linear penalties
constraint_columntexttables: pu's column of the linear constraint
spatialanypenalties and constraints in order: [{kind: boundary|connectivity|asym_connectivity|linear_penalty|linear_constraint|neighbors|contiguity|feature_contiguity, penalty, edge_factor, threshold, sense, column, k, clamp}, ...]
portfoliotextseveral solutions: cuts (the best distinct ones), top (the best, each to optimality), gap (within pool_gap of the optimum), shuffle (the columns in random orders)
number_solutionsnumbera portfolio's solutions (default 10)
pool_gapnumberthe gap portfolio: how far from the optimum (0.1)
seednumberthe shuffle portfolio's random orders (default 0)
remove_duplicatesboolthe shuffle portfolio: distinct solutions (true)
gapnumberthe relative optimality gap (default 0.1)
time_limitnumberseconds (default none)
solvertexthighs (default) or gurobi: Gurobi when it is installed and licensed, else HiGHS with a warning
threadsnumbergurobi: the threads it uses (default and most: Terraflux's threads, never every core)

prioritize.protected_cells#

The selected cells of a solution on raster planning units (landschaft's protected_cells): 1 where more than half selected, 0 elsewhere (missing too), for the restrictions of a land change simulation.

InputTypeWhat it is
solutionrequiredmapa solution (prioritize.optimize's)
OutputTypeWhat it is
mapmap1 protected, 0 not

prioritize.proximity_matrix#

1 for every two planning units within a distance of each other (landschaft's proximity_matrix): cell centres, or polygons by their nearest points.

InputTypeWhat it is
unitsrequiredanythe planning units: a map or a stack (cells), or polygons
OutputTypeWhat it is
tabletablei, j, x: the units (1..) and their value
SettingTypeWhat it is
distancerequirednumberthe distance, in the units' coordinates

prioritize.proxirr#

ProxIRR irreplaceability (Baisero et al. 2022), the bits of R's proxirr: for every feature in a unit alpha = min(1, local / (global - target)), and per unit beta = 1 - prod(1 - alpha) (the chance it is needed for some target) and gamma (the targets it is needed for). From Marxan's tables (pu: id; spec: id, prop or target; puvspr: species, pu, amount), or from maps: every cell a unit, the features' layers its amounts.

InputTypeWhat it is
putablethe planning units: id
spectablethe features: id, prop (a share of the total) or target
puvsprtablethe amounts: species, pu, amount
featuresstackmaps instead of tables: the features' amounts
OutputTypeWhat it is
unitstableper unit: pu, beta, gamma
alphatableper feature in a unit: species, pu, amount, the feature's global amount and target, alpha
targetstableper feature: its id, global amount and target
betamapmaps: each cell's beta
gammamapmaps: each cell's gamma
SettingTypeWhat it is
propanymaps: the targets as a share of each feature's total
targetsanymaps: the features' targets (amounts)
triagebooltargets above the global amount count 0 (default false)

prioritize.refine#

A selection on coarse blocks (of a prioritize.coarsen-ed problem) back on the fine grid (landschaft's refine): every cell its block's value, none where the fine map has none.

InputTypeWhat it is
selectionrequiredmapthe coarse selection
likerequiredmapthe fine cost map
OutputTypeWhat it is
mapmapthe selection on the fine grid

prioritize.unit_points#

A point per planning unit (landschaft's unit_points): the centre of every cell of a map, or a point inside every polygon (GEOS's point on surface); to measure distances between units with cost.distance or cost.commute_distance.

InputTypeWhat it is
unitsrequiredanythe planning units: a map or a stack (cells), or polygons
OutputTypeWhat it is
pointsvectora point per unit, with its number

prioritize.zonation#

Zonation 5's priority ranking (Moilanen et al.), the same rank map as the z5 binary: cells removed one after another by the least marginal loss of the features (rules CAZ1, CAZ2, CAZMAX, ABF, CAZP, CAZPW; RAND, or LOAD a ranking given), with weights, costs, a hierarchic mask and an analysis area. The rank goes from 0 (removed first) to 1 (kept last); the curves tell how much of each feature remains as cells are removed.

InputTypeWhat it is
featuresrequiredstackthe features' distributions, a layer each
costmapthe cost of each cell (no value: 0)
hierarchic_maskmaplevels 0-255: higher levels are removed last
analysis_areamapthe cells ranked (not 0, or the area given)
solutionmapthe ranking LOAD evaluates
condition_mapsstackthe condition of the features' habitat (0-1), a layer each, named in condition
retention_mapsstackthe maps of retention, named in retention
resourcesstackthe interactions' resources, named in interaction
areasmaparea numbers (0: none), for the statistics of areas
comparemapanother solution, for the comparison
impact_mapsstackthe impact scenarios' maps (sources, subareas, losses, pressures), named in them
OutputTypeWhat it is
rankmapthe priority rank of each cell, 0-1
curvestablethe performance curves: the rank, the cost removed and the share of each feature remaining
featurestableper feature ranked: its layer (1..), weight, sum, cells with values, cells without data and quantization error (%)
aucnumberthe area under the curve of the mean remaining share
iterationsnumberthe iterations of the ranking
preprocessingstackwith preprocessing: richness and range-size rarity of the features of positive, negative and zero weight and of every group (weighted too with weights)
transformedstackwith transformed: the features as ranked
area_statisticstableper set of features (weight class 1, -1, 0, or group) and area: size, mean rank, the features' sum (ds) and weighted (wds), relative to the average (rfd, wfd), cost
coveragetableper set and area: the share of every feature in it
area_maskmapthe areas of a range of ranks (1) or its separate areas
comparisontablethe cells chosen in both solutions, only in this, only in the other, in neither
comparison_mapmap1 both, 2 only this, 3 only the other, 4 neither (0 no data)
histogramtableper set of features and bin of coverage: the count of features
impact_zonestableper subarea (0 all), impact group, source, zone (0 the footprint), feature and bin (-1 all): the feature's distribution in the zone, its loss and cells
impact_cumulativetableper subarea, impact group, phase (1 direct habitat loss, 2 cumulative pressures) and feature: its distribution, loss and cells
impact_mapsstackthe impact of every group (ig_zones...)
flexibilitystackhow far each cell could move up, down and both in the order (shares of the cells)
SettingTypeWhat it is
ruletextCAZ2 (default), CAZ1, CAZMAX, ABF, CAZP, CAZPW, RAND, LOAD
rule_paramnumberABF's z (0.25), CAZP's and CAZPW's p (1)
weightsanya weight per feature (default 1)
abf_zanyABF's z per feature (null: rule_param)
weight_groupsanya group per feature (-1 none)
group_weightsany{group: weight} shared by a group's features
thresholdsanyper feature: values below become 0
extractanyper feature: the value its layer is 1 at (null: none)
nodataanyper feature: its file's NoData value (null: none), which value extraction tells from no value
zero_modetextall (default), none or dynamic: the zeros are data
keep_zerosanydynamic: per feature, whether its zeros are data
cost_in_rankingboolthe cost weighs the removal (default true)
areaintegerthe analysis area's value ranked (default 0: every one)
bitsinteger8 (default) or 16: the precision of the data
max_iterationsintegerdefault 500
ranking_errornumberthe error to stop at, % (default 0.01)
stop_on_plateauboolstop when the error no longer falls
smoothing_factornumberdefault 0
curves_intervalnumberthe curves' step, a share of the cells
seedintegerRAND's seed (default 0)
conditionanyper feature: the layer of condition_maps its values are multiplied by (null: none; Zonation's -c)
renormalizeanyper feature (or all): a conditioned feature back to level 1
retentionanyper feature (-r): null, the fraction retained everywhere, a layer of retention_maps (fractions per cell) or {absolute: layer} (amounts per cell)
connectivityanyper feature (-d): null or a kernel {shape: uniform, triangular, negexp or gaussian, distance (cells), cut}: the feature smoothed by it
self_multiplyanyper feature (or all): the smoothed feature times itself
interactionanyper feature (-i): null or {kernel, resource (a layer of resources), positive, beta, normalize}
interaction2anyper feature (-I): interactions after the matrices
matrix_connectivityanyper feature (-m): null or {kernel, matrix}: the features of a matrix smoothed and mixed by it
matricesany{matrix: rows} (a row per source feature, a column per target, in the features' order)
groupsanyan output group per feature (-1 none)
preprocessingboolZonation's pre-processing maps (-b)
impact_groupsanyan impact group per feature (-1 none)
impact_binsanyper feature: null, 0 (ten bins) or the limits of the value classes its impacts are reported in
impactanyan impact scenario (-s): {sources (a layer of impact_maps), impacts: [{group, source, footprint (%), buffers: [[radius, %]...]}], subareas}
cumulative_impactanya cumulative scenario (-e): {direct (sum, product), direct_rasters, direct_matrix, cumulative (variant1, variant2), pressures: [{raster, normalize, offset, divisor}], cumulative_matrix, aggregation (add, multiply, max), functions: [{group, pressure, points}], subareas}
area_statisticsanystatistics of areas: "areas" (the map areas, the default with it), [min_rank, max_rank] or [min_rank, max_rank, min_size] (its separate 8-connected areas)
comparisonany[min_rank, max_rank, min_value, max_value]: the cells ranked so against those of compare valued so
histogramany[min_rank, max_rank, bins]: the features' coverage
flexibilitynumberthe flexibility map's max error (%): how far each cell could move before its loss differs by it
transformedanyper feature (or all): the feature as ranked (-f)
block_rowsintegerZonation adds the features up by blocks of rows: those of the files read (default: one block)

prioritize.zonation_project#

A Zonation 5 project run as the z5 binary runs it (landschaft's run_project): the settings file (.z5), its feature list and link files (conditions, retention, connectivity, weight groups, impact scenarios, binning) read with the switches of the z5 command line, the rasters they name read from disk; the ranking of prioritize.zonation, and with -p the calls of the post-processing file one after another.

OutputTypeWhat it is
rankmapthe priority rank of each cell, 0-1
curvestablethe performance curves: the rank, the cost removed and the share of each feature remaining
featurestableper feature ranked: its layer (1..), weight, sum, cells with values, cells without data and quantization error (%)
aucnumberthe area under the curve of the mean remaining share
iterationsnumberthe iterations of the ranking
preprocessingstackwith preprocessing: richness and range-size rarity of the features of positive, negative and zero weight and of every group (weighted too with weights)
transformedstackwith transformed: the features as ranked
impact_zonestableper subarea (0 all), impact group, source, zone (0 the footprint), feature and bin (-1 all): the feature's distribution in the zone, its loss and cells
impact_cumulativetableper subarea, impact group, phase (1 direct habitat loss, 2 cumulative pressures) and feature: its distribution, loss and cells
impact_mapsstackthe impact of every group (ig_zones...)
area_statisticstable-p: the statistics of areas of every call (area_statistics_external, _rank_range, _separate_areas), the call's number first
coveragetable-p: per call, set and area: the share of every feature in it
comparisontable-p: per solution_comparison call: the cells in both...
histogramtable-p: per histogram call, set and bin: the count of features
post_mapsstack-p: the calls' maps named as Zonation's files (area_statistics_rank_range.mask., solution_comparison.mask., flexibilitymap..up...)
SettingTypeWhat it is
pathrequiredtextthe project's settings file (.z5)
flagstextthe z5 switches: -w weights, -W weight groups, -g output groups, -t thresholds, -c conditions, -r retention, -x/-X cost (tracked / in the ranking), -h hierarchic mask, -a analysis area (--area=N), -b pre-processing maps, -f the features as ranked, -d/-i/-I/-m connectivity, -s/-e impact scenarios, -p post-processing (e.g. "-wg -X")
modetextthe marginal loss rule, z5's --mode (CAZ2 by default; "ABF 0.25"...); a --mode= in flags too
bitsinteger8 (z5, the default) or 16 (z5_16bit)