Skip to content

Commit 6fa84c2

Browse files
Trim PARS vignette prose — drop implementation details
Co-Authored-By: Claude Opus 4.6 <[email protected]>
1 parent 0022d2a commit 6fa84c2

1 file changed

Lines changed: 2 additions & 51 deletions

File tree

vignettes/pars-floodplain.Rmd

Lines changed: 2 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -133,12 +133,7 @@ see the
133133

134134
The vignette renders against pre-computed outputs from
135135
`data-raw/wsg_vignette_data.R` so it builds fast and doesn't touch the
136-
network or database. The hydro / context layers ship as a single
137-
multi-layer GeoPackage and the rasters as separate GeoTIFFs (raster
138-
tiles in GPKG would lose the continuous DTM precision and the binary
139-
valleys semantics — wrong format for analytical layers).
140-
141-
Direct downloads of the cached Parsnip River Watershed Group bundle from the repo (open in QGIS
136+
network or database. Direct downloads of the cached Parsnip River Watershed Group bundle from the repo (open in QGIS
142137
or any GDAL-aware tool):
143138

144139
- [`pars.gpkg`](https://github.com/NewGraphEnvironment/flooded/raw/main/inst/vignette-data/pars.gpkg)
@@ -200,54 +195,10 @@ elsewhere. `flooded::fl_dem_aoi()` reads it via `/vsicurl/`, so the only
200195
bytes transferred are those intersecting the AOI — bandwidth scales
201196
with the AOI, not with the COG size.
202197

203-
The DEM was fetched in `data-raw/wsg_vignette_data.R` with a single
204-
call, passing the streams as the AOI so the crop hugs the stream
205-
corridor (a memory-efficient pattern for large watersheds with sparse
206-
stream networks):
207-
208-
```{r dem-fetch, eval = FALSE}
209-
dem <- flooded::fl_dem_aoi(streams, buffer = 2000)
210-
```
211-
212-
The default `source = NULL` resolves to the canonical MRDEM-30 DTM
213-
`/vsicurl/` URL inside `flooded::fl_dem_aoi()`. `buffer = 2000` extends
214-
the AOI by 2 km in metres before crop. To override the source — e.g.,
215-
to fetch a LidarBC COG — pass `source = "/vsicurl/https://.../tile.tif"`.
216-
217198
## Streams and waterbodies
218199

219200
Streams are habitat segments modelled as accessible to bull trout from
220-
[bcfishpass](https://github.com/smnorris/bcfishpass) outputs. bcfishpass
221-
runs weekly on a hosted virtual machine and republishes the
222-
`streams_bt_vw` view, so the data is current to within a week of any
223-
upstream FWA, observation, or barrier change.
224-
225-
```{r bcfishpass-version, echo = FALSE}
226-
ver <- readRDS(system.file("vignette-data/pars_meta.rds",
227-
package = "flooded", mustWork = TRUE))
228-
```
229-
230-
This run is built against bcfishpass `r ver$bcfishpass_version` (LINEAR
231-
model, completed `r ver$bcfishpass_date`). The version stamp is cached
232-
at data-raw time (see `data-raw/wsg_vignette_data.R`) so the vignette
233-
renders without touching the database.
234-
235-
The streams query is a single
236-
[`fresh::frs_db_query()`](https://newgraphenvironment.github.io/fresh/reference/frs_db_query.html)
237-
call — every row in `bcfishpass.streams_bt_vw` is already classified
238-
accessible (`access IN (1, 2)` = assessed or modelled), so filtering to
239-
"best accessible habitat order 3+" needs no working-table classification:
240-
241-
```r
242-
streams <- fresh::frs_db_query(conn, "
243-
SELECT segmented_stream_id, blue_line_key, waterbody_key,
244-
upstream_area_ha, map_upstream, channel_width, stream_order,
245-
gradient, mapping_code, access, spawning, rearing, geom
246-
FROM bcfishpass.streams_bt_vw
247-
WHERE watershed_group_code = 'PARS'
248-
AND access IN (1, 2)
249-
AND stream_order >= 3")
250-
```
201+
[bcfishpass](https://github.com/smnorris/bcfishpass).
251202

252203
Waterbodies (lakes + wetlands) come from `whse_basemapping.fwa_lakes_poly`
253204
and `whse_basemapping.fwa_wetlands_poly` joined on `waterbody_key` — only

0 commit comments

Comments
 (0)