# stac_uav_bc

## v2.0.0 (2026-10-17)

Three consumer-visible changes in one release, so that consumers absorb one break: the collection
is renamed (#48), the item fields move off `nge:` (#38), and every item of a dataset fitted to
LidarBC carries `alignment:` fields (#41). Eight registry rows are corrected. **Unchanged:** item
ids, the S3 bucket, every asset href and download link, and the asset key `image`.

### The collection is `stac-imagery-uav-bc` (#48)

- `imagery-uav-bc-prod` → **`stac-imagery-uav-bc`**: product first like `stac-airphoto-bc`,
  `stac-elevation-bc`, `stac-floodplains-bc` and `stac-pointcloud-bc`, the stem of the bucket
  (`imagery-uav-bc`), and the pair of the coming `stac-pointcloud-uav-bc` (#42). The title follows,
  `UAV Imagery from British Columbia - stac-imagery-uav-bc`, in `collection.json` and in every
  item's root, parent and collection links; the item's `collection` field names the new id.
- **What a consumer changes:** `collections = "stac-imagery-uav-bc"` in an `rstac` search, and
  anything that reads an item's `collection` field. A QGIS STAC connection lists the collection
  under its new title: re-add it in the browser. Layers already added keep working, because a
  layer holds the asset href.
- **When:** the static catalogue on S3 (`collection.json` and every item JSON) names the new id
  from this release. The API serves both collections from this release until the old one is
  dropped, 2026-10-17 (00:53 UTC), the old one frozen at 1.0.4 with no new flights. After the drop
  `/collections/imagery-uav-bc-prod` answers 404, but a `/search` that still names the old id in
  `collections` answers 200 with **no features**, not an error: an `rstac` query or a report chapter
  left on the old id renders an empty table. Change the id, do not wait for a failure.
- The rename rides on `catalogue_release.sh`: `stacs.toml` is the id's one source,
  `item_create.py --rebuild` stamps it, and a publish refuses a prod tree that names another id.
  The drop is `scripts/config/collection_unregister.sh`, which reports before it deletes, refuses
  the live collection, and refuses while the live collection is not served or lacks an item for
  any item id the old one holds (the recipe is in `scripts/config/README.md`). While both
  collections serve, `item_unregister.sh` deletes from the live one only.

### Item fields move off `nge:` (#38)

Each field's prefix now says what it describes. A saved filter on an old name matches nothing
from this release; the README's field table says what each holds.

| until v1.0.4 | from v2.0.0 |
|---|---|
| `nge:region` | `newgraph:region` |
| `nge:alias` | `newgraph:alias` |
| `nge:project` | `newgraph:project` |
| `nge:stream_name`, `nge:stream_name_02`, `nge:stream_name_03` | `uav:stream_name`, `uav:stream_name_02`, `uav:stream_name_03` |
| `nge:wsg_code` | `fwa:watershed_group_code` |
| `nge:site_id` | `bcfishpass:aggregated_crossings_id` |
| `nge:watershed_group` | dropped: it held the tree's directory slug, which is in the item id |
| — | `fwa:watershed_group_name`, the atlas's name for the group, new |

### Registry corrections

Eight `data/sites.csv` rows change: five rename the stream, which changes `title` and
`uav:stream_name` on their 15 items, and three add a second stream (`uav:stream_name_02`, 9 items):

- `mackenzie/parsnip/2022/125000_parsnip_trib_arctic`: `tributary to Parsnip River` →
  `Tributary to Parsnip River`
- `mackenzie/parsnip/2022/125179_missinka_trib`: `Unnamed tributary to Missinka River` →
  `Tributary to Missinka River`
- `skeena/bulkley/2022/bulkley_dickson_BR1-2021_BR2-2021`: `Tributary to Richfield Creek` →
  `Bulkley River`
- `skeena/zymoetz/2023/8478_mcdonell_trib`: `Copper` → `Tributary to McDonell Lake`
- `skeena/zymoetz/2023/8525_coal_trib`: `Copper` → `Tributary to Coal Creek`
- `skeena/bulkley/2025/buck_bob_buc78` gains `uav:stream_name_02 = Bob Creek`;
  `skeena/bulkley/2025/maxan_foxy_confluence` gains `Foxy Creek`;
  `skeena/morice/2021/198000_mcbride_nanikafsr` gains `McBride Lake`

### Alignment fields (#41)

Every item of a dataset on a LidarBC DEM carries the dataset's fit to it as `alignment:` fields
(#41). The rasters are unchanged.

UAV elevations are GPS-referenced: no flight used ground control, and against the LidarBC 1 m DEM
the published DTMs and DSMs sit a median of 8.3 m off vertically (−97 to +92 m) and 3.2 m
horizontally. The fields give the horizontal shift and the quadratic surface
(offset, tilt, curvature) that put the dataset's ground on LidarBC, and the misfit left (median
0.42 m; 42 of 46 datasets within 1 m):

- `alignment:reference`: the LidarBC delivery fitted against
- `alignment:shift_x_m`, `alignment:shift_y_m`: add to the published coordinates, in the item's CRS
- `alignment:offset_m`, `alignment:tilt_m_per_100m`: the vertical correction at the dataset's centre
  and the tilt's size; `alignment:surface` and `alignment:centre` are the full fit (subtract
  `surface(x - centre)` from the published z)
- `alignment:misfit_m`, `alignment:points`, `alignment:model`: NMAD of the residual over the ground
  points compared, how many, and `quadratic` (a plane, tried first, left a median of 0.78 m on the
  same datasets)
- `alignment:applied`: `false` on every item that carries the fields, the rasters being published as
  ODM wrote them; #46
  publishes them corrected and sets it `true`

The README's "Elevations" section says how to apply them. `data/alignment_lidarbc.csv` is the table,
`scripts/dataset_align-lidarbc.py` writes it, and a publish now needs the dataset's row; the first
publish after this change waits for the release that carries the fields, as after #38. The 31
datasets with no LidarBC under them, the 3 whose fit could not be determined and the 3 with no ODM
point cloud carry no fields.

## v1.0.4 (2026-10-09)

Registration and verification move to [`stacs`](https://github.com/NewGraphEnvironment/stacs), and
the static catalogue's item links are fixed (#35). No item content changes.

**One consumer-visible change:**

- **The static catalogue's item links resolve.** Every `rel: item` href in `collection.json`, and
  every item's `self` link, was `https://imagery-uav-bc.s3.amazonaws.com/<id>/<id>.json`. That key
  has never existed, and S3 answers 403. Anything walking the catalogue from `collection.json`, as
  opposed to querying the API, reached none of the 245 items. They now name the file where the sync
  puts it, `…/<region>/<watershed>/<year>/<item>/<product dir>/<id>.json`. The cause was
  `Collection.add_item()`, which overwrote the self href `item_create.py` had set with pystac's
  default layout. `item_create.py` now refuses to save a `collection.json` whose item links name no
  file in the prod tree. The API was never affected, because pgstac rewrites links.

**Tooling:**

- `scripts/stacs.sh` runs the `stacs` CLI pinned at `v0.1.0`, and `stacs.toml` declares the
  catalogue. Compared with the scripts it replaces, registration no longer puts the database
  password in pypgstac's argv on the host, no longer shares one remote temp path between runs, and
  counts what arrived. Every write is followed by a check that the API serves what was sent.
- `catalogue_release.sh` and `dataset_publish.sh` register with `stacs register --mode drift` and
  check with `stacs verify`, which compares id sets in both directions and every body by digest.
  This replaces the per-item HTTP 200 loop. The release gate is `stacs validate` and `stacs audit`,
  with `--expect` set to the collection's link count, so an old-id item JSON left behind by a rename
  now fails the release instead of being synced.
- Deleted: `scripts/config/item_register.sh`, `scripts/config/collection_register.sh` and
  `scripts/item_validate.py`. `item_unregister.sh` stays, because stacs is upsert-only, and it now
  reads its host and database from `stacs.toml`.

## v1.0.3 (2026-09-24)

Three new 2026 Wedzin Kwa (Morice River) reach surveys, and a stream-name correction across all
seven of them (#27).

- **New:** Pimpernel (morice 2026) — flown 2026-09-22
- **New:** Gosnell confluence (morice 2026) — flown 2026-09-23; the Morice/Thautil/Gosnell
  confluence, and the first dataset to carry all three `nge:stream_name` slots
- **New:** Morice km 61 (morice 2026) — flown 2026-09-23
- Catalogue at 245 items

**One consumer-visible change:**

- All seven `skeena/morice/2026/wedzin_*` datasets now carry `nge:stream_name = "Morice River"`.
  The four flown in July were registered as `"Tributary to Morice River"` from a `guess_nearest_*`
  lookup; they are mainstem reach surveys, and the Morice River is the only named FWA stream inside
  any of their footprints. **A saved `rstac`/QGIS filter on
  `nge:stream_name == 'Tributary to Morice River'` no longer matches them.** Item ids are built from
  directory paths, so no URLs changed and nothing was retracted — only the title and the property.

**Processing fixes — both affect what lands in the catalogue:**

- **ODM was ingesting video frames as survey imagery.** It scans `images/` for video and extracts
  frames from anything it finds; those arrive at 1920x1080 beside 8064x6048 stills. ODM computes GSD
  across every camera and clamps ortho *and* DEM resolution so neither is finer than that GSD, so a
  single clip coarsens all three products. On `wedzin_gosnell_confluence`, 4 frames from one `.MP4`
  put the ortho, DTM and DSM at 6.57 cm/px instead of 5.72. Nothing reported it — every frame
  reconstructed, one component, 1.34 px, and the ortho simply rendered at lower resolution.
  `odm_process-batch.sh` now moves video to `<project>/video/` before stitching. Only that one
  dataset was affected, and it was re-stitched before publication.
- **The COG validation gate could not fail.** `dataset_publish.sh` piped `rio cogeo validate`
  through `conda run`, which captures its child's output rather than passing it through a pipe — so
  nothing was ever printed. And `rio cogeo validate` exits 0 even when it reports *NOT* a valid COG,
  so checking the status would not have helped either. It now matches the verdict text and refuses
  to publish on anything else. All nine COGs in this release were verified against the fixed
  predicate. `item_validate.py` had the same class latent and now refuses an empty result instead of
  reporting `valid: 0` and exiting 0.

**New tooling:**

- `scripts/stream_resolve.py` — reads a flight's image EXIF GPS and asks the public fwapg REST API
  which named FWA streams sit in its footprint. No SSH tunnel and no local Postgres, so it runs
  while ODM has the machine. It resolved all seven rows above.
- `scripts/odm_qc.py` — the recipe's QC step as a gate: fails on a split reconstruction, an
  unfinished run, mixed input resolutions, or reprojection error past 2 px, and notes a dropped-shot
  rate high against the catalogue. Thresholds calibrated on the 76 datasets carrying a `stats.json`.

## v1.0.2 (2026-09-20)

Two new 2026 datasets, plus the catalogue's first before/after pair at one crossing (#22).

- **New:** Pedley Creek (cottonwood 2026, PSCIS 198285) — first dataset in the Cottonwood River
  watershed group (`COTR`), and the first to extend the collection bbox south
- **New:** Tributary to Parsnip River post-replacement (parsnip 2026, PSCIS 199663) — reflown
  2026-09-15 after the culvert replacement; pairs with the 2026-07-14 pre-replacement flight
- Catalogue at 236 items

**Two consumer-visible changes** — both affect existing saved queries:

- `mackenzie/parsnip/2026/1996663_parsnip_trib_chco_11000` is now
  `…/199663_parsnip_trib_chco_11000`. The old directory name carried an extra `6`; `199663` is the
  real `aggregated_crossings_id` and `1996663` does not exist in bcfishpass. **The three old item
  ids are retired and their URLs no longer resolve** — nothing external referenced them
  (checked per #18 before retracting).
- `nge:alias` on that dataset moves from `moose` to `moose pre-replacement`, and the new flight
  carries `moose post-replacement`. **A saved `rstac`/QGIS filter on `nge:alias == 'moose'` will no
  longer match.** The alias is now what distinguishes repeat flights of one site.

Also in this release:

- Item titles include the alias when a row has one: `"<stream> (<alias>) — <year> <product>"`.
  Without it, the two parsnip flights would both read "Tributary to Parsnip River — 2026 orthophoto",
  since they share a stream name and a year. Rows without an alias title exactly as before.
- Collection `extent.spatial` is now recomputed on publish and on rebuild. It never was before, and
  the advertised bbox had drifted badly: **21 items across 7 datasets already fell outside it**,
  including everything in kootenay (Parker Creek at 49.21°N, Hadow Creek at 50.74°N) and four
  mackenzie peace/pine datasets north of 55.6°N. A bbox-filtered `rstac` or QGIS search against the
  collection extent silently missed all of them. The corrected bbox spans
  `[-127.741, 49.209, -114.529, 56.078]`, up from `[-127.741, 53.830, -121.741, 55.314]`.
- `catalogue_release.sh` asserts rather than announces: optional `EXPECT_ITEMS=<n>` checks the live
  count, and every live item is checked for `nge:region` + `nge:stream_name` so a silent registry
  miss — which titles an item from its directory name — fails the release instead of shipping.
- Recipes for repeat flights and for renaming a published dataset added to `scripts/config/README.md`.
  A prefix rename on S3 must be an `aws s3 mv`; left to `sync --delete` it re-uploads the whole
  dataset (4.34 GB here) with no progress output.

## v1.0.1 (2026-08-05)

- Retraction flow: `scripts/config/item_unregister.sh` (pgstac delete over SSH, idempotent) and the `published=false` lifecycle documented in the recipe (#18)
- First retraction: mis-filed `fraser/nechacko/2024/199256_kenneth_hwy16` removed from API + S3 (Kenneth Creek is in Morkill; replacement published at `fraser/morkill/2024/199256_kenneth_hwy16`; Fraser 2023 report updated to the new URLs first)
- New datasets since v1.0.0: Peacock Creek (morice 2025), Tributary to Waterfall Creek (bulkley 2025), Kenneth Creek morkill copy — catalog at 230 items

## v1.0.0 (2026-08-03)

First versioned release of the catalogue — 224 items across fraser, skeena, mackenzie, and kootenay.

- `data/sites.csv` is now the source of truth for site metadata (#16): stream names (up to three per flight), FWA watershed group codes, bcfishpass `aggregated_crossings_id`, aliases, and per-site notes. The catalogue is a reproducible build artifact: `scripts/catalogue_release.sh` rebuilds, validates, syncs, registers, and verifies in one command.
- Items carry `title` and queryable `nge:` properties (`region`, `watershed_group`, `wsg_code`, `site_id`, `stream_name`, `alias`, `project`) — filter with e.g. `rstac` on `nge:wsg_code == 'MORR'`.
- Item geometries are true valid-data footprints (`gdal_footprint`), replacing rectangular bboxes that overstated corridor flights 2-3x; report maps can now pull honest outlines via spatial search.
- Items carry flight capture datetimes (#9, since 2026-07); collection stamped with the STAC Version Extension.
- Script naming converged with stac_dem_bc (`item_create.py`, `item_validate.py`, `item_register.sh`, `collection_register.sh`, `dataset_publish.sh`, `catalogue_release.sh`).

Known imperfections shipping deliberately (fixes are v1.1.0's job and the release-system test): 11 stream names are nearest-stream guesses, two bulkley tokenizer artifacts (`Groot05 Creek`, `Rd Creek`), four crossing ids awaiting db verification — all flagged in `name_source`/`notes` columns of `data/sites.csv`.
