Skip to contents

Taxa whose extinction risk is SPATIAL — a per-cell ER surface built from Distinct Population Segment polygons (sea turtles from SWOT + NMFS DPS since v4b; from v9.1 any species with NMFS DPS boundaries — but those now use dps_sql(), which keeps the distribution as the model) merge differently: the per-cell ER surface (turtle_ds, one or more datasets) is multiplied by the suitability (suit_ds), floored at 1 over the ER footprint, then critical-habitat datasets (ch_keys) override with a max. val = greatest(1, round(er * suit / 100)) then greatest(that, ch). Reads a source relation src with (ms_merge_key, ds_key, cell_id, val).

Usage

turtle_sql(turtle_ds, suit_ds, ch_keys, src = "turtle_src")

Arguments

turtle_ds

character vector; ds_key(s) of the per-cell extinction-risk dataset(s).

suit_ds

character vector; ds_key(s) of the suitability dataset(s) ("am", or c("am", "ax") from v9 — after supersede_sql() at most one survives per cell, and max() over the survivors is the value).

ch_keys

character vector of critical-habitat ds_keys that override with a max (may be empty).

src

character; name of the source relation to read (default "turtle_src").

Value

SQL string selecting (mdl_key, cell_id, val) — the whole-range turtle surface.

Details

This is what keeps an Endangered species from painting flat: the plain rule values every range cell at the taxon's governing ER (max(er, suit) = 100 everywhere for NMFS:EN), while here the ER varies by DPS and the suitability still shows through.