Runs computeDetrendedRaster for each requested method and produces: a comparison figure (all methods on a shared color scale, plus difference panels against the first method), the gradeline fit diagnostic when applicable, and optionally a KMZ in which each method is a separately toggleable Google Earth overlay.

compareDetrendMethods(
  transectObject,
  rasterDir = NULL,
  methods = c("crossSection", "streamLine", "gradeline"),
  engine = NULL,
  sectionName = "detrend",
  rasterPaletteLims = c(-2, 2),
  exportKmz = FALSE
)

Arguments

transectObject

Object from the ProcessSpace pipeline (needs buildXSectionPlot to have run if "crossSection" is among the methods).

rasterDir

DEM path (unused when the DEM is stored on the object).

methods

Character vector of methods to compare.

engine

Interpolation engine passed to computeDetrendedRaster. Default NULL: each method uses its own default (krige for crossSection, broad-window IDW otherwise). Pass "idw" to compare all methods on the same smoothed engine.

sectionName

Base name for output files (<sectionName>_detrendComparison.png / .kmz).

rasterPaletteLims

Shared color-scale limits (m).

exportKmz

Logical; also write the multi-overlay KMZ.

Value

Invisibly, a list with rasters (named list of SpatRasters), comparisonPlot, differencePlot, and gradelinePlot (NULL unless "gradeline" was run).