
Export Per-Country Gear-Specific Effort as Zipped Shapefiles
Source:R/export.R
export_effort_gear_shapefiles.RdBuilds, for each country, an all-time H3 fishing-effort layer broken down by
gear class and uploads it to cloud storage as a zipped ESRI Shapefile bundle
(the shapefile set plus a plain-text data dictionary). Intended for partners
who consume GIS files rather than the web JSON exports from
export_pds_spatial().
Usage
export_effort_gear_shapefiles(
h3_res = 9L,
countries = NULL,
log_threshold = logger::DEBUG,
package = "coasts"
)Arguments
- h3_res
Integer. H3 resolution of the effort grid to export. Default
9L.- countries
Optional character vector of country names to export. When
NULL(default) every country present in the grid is exported, except the"unknown"bucket (trips with no device metadata).- log_threshold
Logging threshold. Default
logger::DEBUG.- package
Name of the package whose
inst/conf.ymlto read. Defaults to"coasts".
Value
Invisibly, a character vector of the uploaded .zip object names
(or NULL if the grid was unavailable or lacked the gear/country columns).
Details
Reads the gear/country-partitioned H3 effort grid
(predicted-pds-h3_grid_r{h3_res}) produced by aggregate_pds_effort().
For each country it:
Collapses the per-year rows to one row per
(h3_index, gear), summingfishing_hoursandunique_tripsand taking the union ofactive_datesfor an exact active-day count (sohrs_dayis correct across years).Attaches H3 hexagon polygons via
create_spatial_grid().Renames columns to <=10-character names (the ESRI Shapefile DBF limit).
Writes the shapefile set and a
README.txtdata dictionary, zips them, and uploads a versioned.zipto the coasts bucket.
Shapefile fields: h3_id, gear_class, fish_hrs (total fishing hours),
trips (unique trips), n_days (active days), hrs_day (fishing hours per
active day).