Counts what Peskas has collected in each country and district (survey
submissions, enumerators, landing sites, the dates covered and GPS-tracked
trips) and writes the numbers as of today to the collection_stats table of
the Airtable frame base, one row per country and one per district.
Usage
export_collection_stats(log_threshold = logger::DEBUG, package = "coasts")Details
Every number comes from an output that already exists:
Submissions, landing sites and dates: each country's
trips-rawandtrips-validatedfiles in the peskas-api bucket (api.trips), so survey programmes the API does not publish are not counted.Enumerators: the
surveys_flags-<form id>collections of the validation database, for the forms in those files. Kenya's WCS form records no enumerator, so its submissions add none. Timor-Leste's enumerators share logins and its flags name the reporting region instead, one enumerator each, so there regions are counted.GPS trips: the country's
pds-tripsfile for the country row; for a district row, the tripsgenerate_fleet_analysis()places in it (<country>-aggregated).
Rows are matched on key (kenya, kenya-103651), so each run overwrites
the previous numbers; a district that drops out keeps its last ones.
