Skip to content

Replace raw SQL in network_extract.R with fresh::frs_network() #22

@NewGraphEnvironment

Description

@NewGraphEnvironment

Problem

data-raw/network_extract.R uses raw SQL with DBI::dbConnect() and sf::st_read() to query the stream network between two points on the Bulkley mainstem. This is exactly the network subtraction pattern that fresh::frs_network() now handles via the upstream_measure parameter.

50 lines of hand-written SQL + connection management should be one frs_network() call.

Proposed Solution

Replace the raw SQL in network_extract.R with fresh::frs_network(). Verify output matches the current bundled inst/testdata/streams.gpkg (same segments, same attributes).

No changes to vignettes — they use bundled data and work offline.

Relates to NewGraphEnvironment/sred-2025-2026#5

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