Skip to content

frs_break_find: capture both edges of gradient threshold crossings #85

@NewGraphEnvironment

Description

@NewGraphEnvironment

Problem

frs_break_find(attribute = "gradient") only creates breaks where gradient EXCEEDS the threshold. It does not create breaks where gradient drops BACK BELOW the threshold. This means the transition from "too steep" back to "suitable habitat" is not captured — the downstream portion stays merged with the steep section, and frs_col_generate computes an averaged gradient across the transition.

Example at 100m intervals, threshold 5.49%:

200m: 7% (above → break)
300m: 8% (above → break)
400m: 6% (above → break)
500m: 4% (below → NO break ← bug)
600m: 3% (below)

The 500-600m section at 3-4% (good habitat) stays attached to the 400-500m steep section. Classification is wrong.

Considerations before fixing

Segment count explosion

Adding "back below" breaks roughly doubles break points per threshold. With 7 gradient thresholds across species and 100m intervals, segment counts could go from 4x to 30x+ the base FWA network. Province-wide this is significant.

Interval parameter

The interval parameter (default 100m) controls sampling resolution. Options:

  • 100m: precise, many breaks, 30x+ inflation risk
  • 500m: coarser, fewer breaks, might miss short steep sections (<500m)
  • User-configurable (already is): let users choose precision vs volume

FWA segment design

FWA segments come from 1:20k cartographic mapping — vertices at bends, confluences, waterbody boundaries. Segments are typically 100-500m. The gradient on each is computed from endpoint Z values. Understanding FWA segment design may inform what interval makes sense.

Questions

  1. What interval does bcfishpass use for gradient barrier detection?
  2. Does bcfishpass capture both edges of threshold crossings?
  3. What does the FWA User Guide say about segment construction and Z values?
  4. At 500m intervals, how many short steep sections (<500m) would we miss?
  5. Is the segment inflation acceptable for the spatial precision gained?

Relates to

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions