Repository navigation
Habitat eligibility override CSV with edge_type and feature_code defaults #19
Description
Context
link ships an override CSV for parameters_habitat.csv that defines what qualifies as habitat per species. The override starts from bcfishpass v0.5.0 defaults and departs where biological rationale supports it. Each departure tracked as a separate issue.
fresh#100 (fresh 0.9.0) adds edge_type filtering, fresh#105 adds feature_code categories, fresh#102 exposes params so link can pass its own CSV. This issue is about the link-side override.
bcfishpass v0.5.0 defaults (edge_types)
| Species | spawn_edge_types | rear_edge_types | Notes |
|---|---|---|---|
| BT | stream, canal | No rearing edge filter. Rivers included via waterbody_type join. | |
| CH | stream, canal | stream, canal | Rivers via waterbody_type. |
| CM | stream, canal | No freshwater rearing. | |
| CO | stream, canal | stream, canal | CO wetland-flow carve-out (1050/1150). Rivers via waterbody_type. |
| PK | stream, canal | No freshwater rearing. | |
| SK | stream, canal | Lake rearing via rear_lake_ha_min. No waterbody_type join. | |
| ST | stream, canal | stream, canal | Rivers via waterbody_type. |
| WCT | stream, canal | stream, canal | Rivers via waterbody_type. |
Note: bcfishpass v0.5.0 stream = 1000/1100 only (excludes 1050/1150 wetland-flow). fresh 0.9.0 stream category = 1000/1050/1100/1150. So fresh defaults already include wetland-flow streams.
bcfishpass v0.5.0 does not filter by feature_code.
Proposed link overrides
Edge types
| Species | spawn_edge_types | rear_edge_types | Diff from bcfishpass v0.5.0 |
|---|---|---|---|
| BT | stream, canal | stream, canal, river, lake | +river, +lake for rearing |
| CH | stream, canal, river | stream, canal, river, lake | +river for spawning, +river/lake for rearing |
| CM | stream, canal, river | +river for spawning | |
| CO | stream, canal, river | stream, canal, river, lake, wetland | +river for spawning, +river/lake/wetland for rearing |
| PK | stream, canal, river | +river for spawning | |
| SK | stream, canal | lake | Explicit lake rearing via edge_type (alongside rear_lake_ha_min) |
| ST | stream, canal, river | stream, canal, river, lake | +river for spawning, +river/lake for rearing |
| WCT | stream, canal, river | stream, canal, river, lake | +river for spawning, +river/lake for rearing |
Feature types
| Species | spawn_feature_types | rear_feature_types | Rationale |
|---|---|---|---|
| All | stream_definite, stream_intermittent | stream_definite, stream_intermittent, lake, reservoir | Include intermittent — fish use seasonal streams for spawning/rearing. Exclude ditch, industrial. |
Key departures requiring evidence (separate issues)
- Lakes for rearing (BT, CH, CO, ST, WCT) — bcfishpass v0.5.0 doesn't model lake rearing for most species. Many species rear in lakes (documented in Build fish passage connectivity literature RAG store #2 literature RAG).
- Intermittent streams included — bcfishpass v0.5.0 doesn't filter on feature_code so these are implicitly included. We're explicit about it.
- Wetland-flow streams for spawning — fresh 0.9.0
streamcategory includes 1050/1150. bcfishpass v0.5.0 excludes them. Streams through wetlands can be spawning habitat. - Rivers for spawning — bcfishpass v0.5.0 includes via waterbody_type join. We include via edge_type category directly.
- Ditches excluded — not in any category. Fish may use ditches but we don't model them as habitat.
Implementation
Ship inst/extdata/parameters_habitat.csv as a complete override. Pass to fresh via:
frs_habitat(conn, "ADMS",
params = frs_params(csv = system.file("extdata", "parameters_habitat.csv", package = "link")))Relates to NewGraphEnvironment/fresh#100, NewGraphEnvironment/fresh#102, NewGraphEnvironment/fresh#105, #18
Activity
NewGraphEnvironment commentedon May 3, 2026
Closing — superseded by the current overrides infrastructure:
inst/extdata/configs/{bcfishpass,default}/dimensions.csvwith the column-driven rule emission vialnk_rules_build(). The departures table in this issue (per-species edge_types) is now expressed viaspawn_stream/rear_stream/rear_lake/rear_wetlandcolumns + theedge_types/edge_types_explicitrule emission.user_habitat_classification.csvconsumed byfresh::frs_habitat_overlay()inlnk_pipeline_classify().The "override CSV" framing has effectively become "the dimensions.csv + the overrides directory + the rules.yaml emission" together. Each named departure has its own column in dimensions.csv; the methodology research doc
research/default_vs_bcfishpass.mddocuments the deltas.