R/reportingPolygonCrossings.R
buildCrossedReportingPolygons.RdRestores the v2 per-tenure reporting units on top of v3's study-area-clipped layers.
Each tenure in the tenure layer (dissolved to one geometry per tenure, see
reportingPolygonLayers()$isTenure) is crossed — via joinReportingPolygons() —
with:
buildCrossedReportingPolygons(
polys,
landbases = list(),
layers = reportingPolygonLayers(),
members = NULL,
min_area_km2 = 1
)Named list of study-area-clipped reporting layers, keyed by NAME_SHORT
(the output of buildReportingPolygons()); must contain the tenure layer.
Named list of per-tenure landbase coverages keyed
"<tenure> <NAME_SHORT>" (the output of buildLandbasePolygons()); may be empty.
Candidate-layer table (default reportingPolygonLayers()), supplying
isTenure and cross.
optional character vector of the study area's member tenure short
names (a study-area group's name_shorts from studyAreaCrosswalk()). When supplied,
only members are crossed. Tenure polygons overlap in the v10 layer, so clipping to a
group boundary also catches neighbouring tenures that belong to a different group —
and since the crosswalk assigns each tenure to exactly one group, crossing them here
would report a fragment of a tenure that is reported in full elsewhere. NULL (the
default) crosses every tenure present.
numeric; tenures contributing less than this to the study area are
not crossed (default 1). A neighbouring tenure that merely grazes the study-area
boundary would otherwise mint a full set of reporting units over a handful of pixels.
Crossed units (all features sharing a Name) smaller than this are merged into the
neighbouring unit of the same layer that they share the longest border with (see
spatialutils::eliminate_slivers()); a small unit with no neighbour, or a layer made up
only of small units, is dropped. 0 disables both.
A named list of crossed layers (SpatVectors), ready to be appended to the
reportingPolygons input to NRV_summary. The tenure-crossed landbases are included
here, so the raw landbases list should not also be appended.
every sub-region layer marked cross in layers (Caribou ranges, Alberta Natural
Subregions, BC biogeoclimatic zones, NWT/national ecoregions, national ecozones);
its own active/passive landbase coverage(s), if any (buildLandbasePolygons());
and, where a tenure has both, the landbase and Caribou crossing together — the
triple (tenure x landbase x Caribou) v2 produced for the West Fraser CLS blocks.
Products are named "<tenure> <layer NAME_SHORT>" (e.g. "SprayLake ANSR",
"Tolko_Vand_WF_SL LB_S17 Caribou"), so each is a distinct reportingPolygons entry
with its own refCode, parquet aggregate directory, and figure folder. Their features
are named "<sub-region> <tenure>" by the concatenation in joinReportingPolygons().
Crossings that do not intersect are dropped.