Extract unsimplified, flowline-connected inundation footprints at two analyst-selected elevations.

water_surface_extents(rem, flowline, channel_elevation, floodplain_elevation)

Arguments

rem

A single-layer terra SpatRaster containing relative elevations.

flowline

An sf flowline in the same coordinate reference system.

channel_elevation, floodplain_elevation

Finite REM elevations in the raster's vertical units. The channel elevation must be strictly lower.

Value

A list of sf polygons named channel, floodplain, channel_outer, and floodplain_outer. The first two preserve interior holes; the outer footprints fill holes without bridging disconnected components.

Details

This uses the bathtub threshold and retains components intersecting the flowline. Footprints describe inundation, not measured flow paths or bank lines.