Skip to content

Extract fly package from airbc photo selection functions #16

@NewGraphEnvironment

Description

@NewGraphEnvironment

Problem

The flood_* functions in R/utils_photos.R and estimate_footprint() in R/utils_geo.R are generic enough to work for any BC airphoto project. They should live in a standalone package (fly — Floodplain Land-use through Years) rather than being sourced from the app.

Additionally, the app currently filters photos by centroid-in-AOI which misses photos whose footprint overlaps the AOI but centroid falls outside. The package will fix this with proper footprint-polygon intersection.

Proposed Solution

New repo NewGraphEnvironment/fly with functions:

  • fly_footprint() — centroid + scale → footprint polygon (fix CRS to 3005, add GSD support)
  • fly_filter() — filter by footprint-intersects-AOI (replaces buffer hack)
  • fly_summary() — footprint sizes and date ranges by scale
  • fly_coverage() — % AOI covered, grouped by year/scale/roll
  • fly_select() — greedy set-cover with priority = TRUE for auto resolution sorting
  • fly_query_*() — bcfishpass DB helpers (optional)

airbc then becomes library(fly) instead of source("R/utils_photos.R").

Relates to NewGraphEnvironment/sred-2025-2026#17

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