R/reportingPolygons.R
landbaseLayers.RdThe per-FMA landbase-status ("active/passive", a.k.a.
"contributing/non-contributing") coverages, each fetched, dissolved by status,
and clipped to the study area by buildLandbasePolygons(). This generalises
the per-study-area landbase processing formerly hard-coded across the
LandWeb_preamble study-area helpers (SprayLake.R, WestFraser.R,
Tolko.R, SundreFP.R, Manning.R).
landbaseLayers()A tibble with columns key, NAME_SHORT, tenure, source, id,
layer, and status_col.
A landbase coverage belongs to one tenure (not every tenure has one), so
tenure holds that tenure's curated short name (tenureShortNames()):
buildLandbasePolygons() fetches a source only when its tenure is present
in the study area, avoiding the download of large (multi-GB) coverages that
could not intersect it anyway. A coverage is assigned to the tenure it lies
in, which need not be the company in its key: it is crossed only with that
tenure, so one assigned to a tenure it does not overlap yields no reporting
unit. status_col is the source attribute holding the
landbase status; layer names the layer for multi-layer File Geodatabases
(NA = the source's only/first layer). NAME_SHORT names the coverage within
its tenure; it need only be unique within a tenure, since the
reporting-unit name is "<tenure> <NAME_SHORT>".
source says how a coverage is fetched: "drive" (a zipped file on Google
Drive, by file id), "url" (a zipped file at a URL), or "drive_gdb" (a
Google Drive folder holding a File Geodatabase, by folder id, downloaded file
by file into destinationPath). Rows can read different layers of one source,
which is then fetched once.
Gating was formerly a regex (applies_to) matched against the
study-area name, which silently stopped matching anything once study areas
became ecoregion groups ("WesternAlbertaUpland" matches no company name), so
no landbase was ever fetched. Gating on the tenures actually present restores it.