Compare a rebuilt product against the one it replaces
Source:R/compare_products.R
hf_compare_products.RdDiffs two NextGen GeoPackages on the things an intra-build invariant cannot see: whether features were lost, and whether a flowpath that owned a divide still owns one. A flowpath silently reclassified as a connector passes every check in the suite, so a rebuild that drops divides can otherwise look clean.
What this can and cannot decide
A difference is only evidence of a regression when the inputs were the same.
Hold them constant and any loss is attributable to the code: that is the case
this was written for, and the one where strict = TRUE belongs.
Across an input change it reports rather than decides. Hydrolocations force reach splits, so a different hydrolocation set legitimately adds, removes and resizes divides; a divide whose POI is no longer in the set is supposed to disappear. Used as a gate there it fails a correct build, so read the output and account for the differences instead.
With both changed at once nothing is attributable. When a new input set and new code both need to land, build one unit on the new inputs with the current code first and compare that, one VPU is a couple of hours against a national run's tens of hours, and it buys an interpretable answer.
Examples
if (FALSE) { # \dontrun{
# Same inputs, changed code: a loss is a regression, so gate on it.
hf_compare_products("before/ngen_vpu04.gpkg", "after/ngen_vpu04.gpkg",
strict = TRUE)
# New hydrolocation set: report and account for the differences.
hf_compare_products("baseline/ngen_vpu04.gpkg", "rebuild/ngen_vpu04.gpkg")
} # }