Builds footprint polygons for each photo, intersects with the AOI, and reports percent coverage grouped by a column.
Arguments
- photos_sf
An sf point object with a
scalecolumn. Geometry must be POINT — the ground footprint is estimated from a centroid, so passing footprints back in is refused rather than coerced.- aoi_sf
An sf polygon to check coverage against.
- by
Column name to group by (default
"photo_year").- dem
Optional elevation raster passed to
fly_footprint(), sizing each frame from its height above ground instead of the reported scale. See the Terrain section offly_footprint().
Examples
centroids <- sf::st_read(system.file("testdata/photo_centroids.gpkg", package = "fly"))
#> Reading layer `photo_centroids' from data source
#> `/home/runner/work/_temp/Library/fly/testdata/photo_centroids.gpkg'
#> using driver `GPKG'
#> Simple feature collection with 20 features and 16 fields
#> Geometry type: POINT
#> Dimension: XY
#> Bounding box: xmin: -126.7631 ymin: 54.34512 xmax: -126.449 ymax: 54.47635
#> Geodetic CRS: WGS 84
aoi <- sf::st_read(system.file("testdata/aoi.gpkg", package = "fly"))
#> Reading layer `aoi' from data source
#> `/home/runner/work/_temp/Library/fly/testdata/aoi.gpkg' using driver `GPKG'
#> Simple feature collection with 1 feature and 0 fields
#> Geometry type: MULTIPOLYGON
#> Dimension: XY
#> Bounding box: xmin: -126.75 ymin: 54.34813 xmax: -126.45 ymax: 54.47
#> Geodetic CRS: WGS 84
fly_coverage(centroids, aoi, by = "scale")
#> Spherical geometry (s2) switched off
#> Spherical geometry (s2) switched on
#> # A tibble: 2 × 4
#> scale n_photos covered_km2 coverage_pct
#> <chr> <int> <dbl> <dbl>
#> 1 1:12000 10 14.8 59.5
#> 2 1:31680 10 24.8 100
