Add KNN snap params and split stream filtering guards#23
Merged
NewGraphEnvironment merged 5 commits intomainfrom Mar 9, 2026
Merged
Add KNN snap params and split stream filtering guards#23NewGraphEnvironment merged 5 commits intomainfrom
NewGraphEnvironment merged 5 commits intomainfrom
Conversation
When blue_line_key or stream_order_min is provided, bypass fwa_indexpoint() and use KNN against fwa_stream_networks_sp with measure derivation and boundary clamping (bcfishpass pattern). KNN path also filters out placeholder streams (999 wscode), subsurface flow (edge_type 1410/1425), and unmapped tributaries (NULL localcode). Fixes #16 Fixes #17 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Filter out placeholder streams (999 wscode), subsurface flow (edge_type 1410/1425), and unmapped tributaries (NULL localcode) by default when querying fwa_stream_networks_sp. Matches bcfishpass universal filter pattern. Add include_all param to bypass when needed. Applied to: frs_network_upstream(), frs_network_downstream(), frs_network_prune(), frs_stream_fetch(), and frs_network() (both direct and waterbody CTE paths). Also replaces remaining %||% with if/else for R < 4.4 compatibility. Fixes #15 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Underground conduits (edge_type 1410) are real stream connectivity — commonly decent streams that should not be filtered from network queries. Split guards: .frs_stream_guards() excludes only placeholder (999 wscode) and unmapped (NULL localcode); new .frs_snap_guards() adds subsurface exclusion for KNN snap path where snapping to a culvert is not useful. Relates to #15 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
blue_line_keyandstream_order_minparams tofrs_point_snap()for targeted KNN snapping (Add blue_line_key hint to frs_point_snap() #16, Add stream_order_min filter to frs_point_snap() #17, Enhanced snap: multi-candidate scoring from bcfishpass #7, Multi-candidate scored snapping with bcfishpass patterns #18).frs_snap_guards()from.frs_stream_guards()for the splitfrs_point_snap_knn()instead of hardcoded predicatesTest plan
Relates to NewGraphEnvironment/sred-2025-2026#16
🤖 Generated with Claude Code