Important
In this guide, we will see how to generate a GeoLocator Data Package from a GeoPressureTemplate folder. This GeoPressureTemplate project need to have: - Updated the
DESCRIPTION
file with all relevant information, includingversion
,contributors
,licences
etc… - Performed the workflow analysis described in the GeoPressureManual so that you have one interimRData
file per tag, with all ouputs you would like to publish (i.e. ideally the trajectory). - Ideally, you would have created thetag.csv
andobservations.csv
files in thedata/
folder.
Create an (empty) datapackage
We can generate a GeoLocator Data Package from a GeoPressureTemplate folder with create_gldp_geopressuretemplate()
. This function will read the DESCRIPTION
file and create a frictionless package with the metadata. At this stage, no data is added to the package.
directory <- "/Users/rafnuss/Library/CloudStorage/OneDrive-Vogelwarte/WoodlandKingfisher"
pkg <- create_gldp_geopressuretemplate(directory)
Additional metadata can be added or edited.
# There are no embargo by default (1970-01-01)
pkg$embargo <- "2030-01-01"
# And the url to an image describing your datapackage
pkg$image <- NULL
# You can also add keywords:
pkg$keywords <- c("Woodland Kingfisher", "intra-african", "multi-sensor geolocator")
# Add DOI of the datapackage if already available or reserve it https://help.zenodo.org/docs/deposit/describe-records/reserve-doi/#reserve-doi
pkg$id <- "https://doi.org/10.5281/zenodo.11207141"
# Provide the recommended citation for the package
pkg$citation <- "Nussbaumer, R., & Rime, Y. (2024). Woodland Kingfisher: Migration route and timing of South African Woodland Kingfisher (v1.1). Zenodo. https://doi.org/10.5281/zenodo.11207141"
# Funding sources
pkg$grants <- c("Swiss Ornithological Intitute")
# Identifiers of resources related to the package (e.g. papers, project pages, derived datasets, APIs, etc.).
pkg$relatedIdentifiers <- NULL
# List of references related to the package
pkg$references <- NULL
pkg$reference_location <- list(
lat = 45.211,
lon = 34.25
)
Add data to the package
After creating the package, we can add the data to the package. If present, the data is read preferentially from the interim RData
files.
Warning
The
RData
files data should be generated through the GeoPressureR workflow functionsgeopressuretemplate()
. Read more on the GeoPressureManual.
pkg <- pkg %>%
add_gldp_geopressuretemplate(directory)
print(pkg)
#> A GeoLocator Data Package with 7 resourcess:
#> • tags
#> • observations
#> • measurements
#> • twilights
#> • staps
#> • paths
#> • edges
#> Use `unclass()` to print the Data Package as a list.
If you haven’t run the GeoPressureR workflow but still want to create a GeoLocator Data package from the raw data, you can still use add_gldp_geopressuretempate
with from="raw-tag"
, reading directly the data from “./data/raw-tag/”.
create_gldp_geopressuretemplate(directory) %>%
add_gldp_geopressuretemplate(directory, from = "raw-tag")
#> ⠙ 1/5 ETA: 11s |
#> ⠹ 2/5 ETA: 8s |
#> ⠸ 4/5 ETA: 3s |
#> A GeoLocator Data Package with 3 resourcess:
#> • tags
#> • observations
#> • measurements
#> Use `unclass()` to print the Data Package as a list.
Check package
Finally, we can check the package to ensure that it is compliant with the GeoLocator Data Package standard.
check_gldp(pkg)
#>
#> ── Check GeoLocator DataPackage profile ──
#>
#> ✔ $schema is valid.
#> ✔ licenses is valid.
#> ✔ licenses[[1]] is valid.
#> ✔ title is valid.
#> ✔ contributors is valid.
#> ✔ contributors[[1]] is valid.
#> ✔ contributors[[2]] is valid.
#> ✔ embargo is valid.
#> ✔ name is valid.
#> ✔ description is valid.
#> ✔ homepage is valid.
#> ✔ version is valid.
#> ✔ resources is valid.
#> ✔ resources[[1]] is valid.
#> ✔ resources[[2]] is valid.
#> ✔ resources[[3]] is valid.
#> ✔ resources[[4]] is valid.
#> ✔ resources[[5]] is valid.
#> ✔ resources[[6]] is valid.
#> ✔ resources[[7]] is valid.
#> ✔ created is valid.
#> ✔ keywords is valid.
#> ✔ keywords[[1]] is valid.
#> ✔ keywords[[2]] is valid.
#> ✔ keywords[[3]] is valid.
#> ✔ id is valid.
#> ✔ citation is valid.
#> ✔ grants is valid.
#> ✔ grants[[1]] is valid.
#> ✔ reference_location is valid.
#> ✔ reference_location$lat is valid.
#> ✔ reference_location$lon is valid.
#> ✔ temporal is valid.
#> ✔ temporal$start is valid.
#> ✔ temporal$end is valid.
#> ✔ taxonomic is valid.
#> ✔ taxonomic[[1]] is valid.
#> ✔ Package is consistent with the profile.
#>
#> ── Check GeoLocator DataPackage Resources
#>
#> ── Check GeoLocator DataPackage Resources tags ──
#>
#> ✔ tags$tag_id is valid.
#> ✔ tags$ring_number is valid.
#> ✔ tags$scientific_name is valid.
#> ✔ tags$manufacturer is valid.
#> ✔ tags$model is valid.
#> ✔ tags$firwmare is valid.
#> ✔ tags$weight is valid.
#> ✔ tags$attachment_type is valid.
#> ✔ tags$readout_method is valid.
#> ✔ tags$tag_comments is valid.
#> ✔ Table tags is consistent with the schema.
#>
#> ── Check GeoLocator DataPackage Resources observations ──
#>
#> ✔ observations$ring_number is valid.
#> ✔ observations$tag_id is valid.
#> ✔ observations$observation_type is valid.
#> ✔ observations$datetime is valid.
#> ✔ observations$latitude is valid.
#> ✔ observations$longitude is valid.
#> ✔ observations$location_name is valid.
#> ✔ observations$device_status is valid.
#> ✔ observations$observer is valid.
#> ✔ observations$catching_method is valid.
#> ✔ observations$life_stage is valid.
#> ✔ observations$sex is valid.
#> ✔ observations$condition is valid.
#> ✔ observations$mass is valid.
#> ✔ observations$wing_length is valid.
#> ✔ observations$additional_metric is valid.
#> ✔ observations$observation_comments is valid.
#> ✔ Table observations is consistent with the schema.
#>
#> ── Check GeoLocator DataPackage Resources measurements ──
#>
#> ✔ measurements$tag_id is valid.
#> ✖ measurements$sensor has 224911 items that are not in the allowed values:
#> "light, pressure, activity, pitch, temperature, airtemperature, acceleration_x, acceleration_y, acceleration_z, magnetic_x, magnetic_y, magnetic_z". Invalid value:
#> "temperature_external"
#> ✔ measurements$datetime is valid.
#> ✔ measurements$value is valid.
#> ✔ measurements$label is valid.
#> ✖ Table measurements is not consistent with the schema.
#>
#> ── Check GeoLocator DataPackage Resources twilights ──
#>
#> ✔ twilights$tag_id is valid.
#> ✔ twilights$twilight is valid.
#> ✔ twilights$rise is valid.
#> ✔ twilights$label is valid.
#> ✔ Table twilights is consistent with the schema.
#>
#> ── Check GeoLocator DataPackage Resources staps ──
#>
#> ✔ staps$tag_id is valid.
#> ✔ staps$stap_id is valid.
#> ✔ staps$start is valid.
#> ✔ staps$end is valid.
#> ✔ staps$known_lat is valid.
#> ✔ staps$known_lon is valid.
#> ✔ staps$include is valid.
#> ✔ Table staps is consistent with the schema.
#>
#> ── Check GeoLocator DataPackage Resources paths ──
#>
#> ✔ paths$tag_id is valid.
#> ✔ paths$stap_id is valid.
#> ✔ paths$type is valid.
#> ✔ paths$lat is valid.
#> ✔ paths$lon is valid.
#> ✔ paths$ind is valid.
#> ✔ paths$j is valid.
#> ✔ paths$interp is valid.
#> ✔ paths$known is valid.
#> ✔ Table paths is consistent with the schema.
#>
#> ── Check GeoLocator DataPackage Resources edges ──
#>
#> ✔ edges$tag_id is valid.
#> ✔ edges$stap_s is valid.
#> ✔ edges$stap_t is valid.
#> ✔ edges$lat_s is valid.
#> ✔ edges$lon_s is valid.
#> ✔ edges$lat_t is valid.
#> ✔ edges$lon_t is valid.
#> ✔ edges$s is valid.
#> ✔ edges$t is valid.
#> ✔ edges$j is valid.
#> ✔ edges$start is valid.
#> ✔ edges$end is valid.
#> ✔ edges$n is valid.
#> ✔ edges$distance is valid.
#> ✔ edges$bearing is valid.
#> ✔ edges$gs_u is valid.
#> ✔ edges$gs_v is valid.
#> ✔ edges$ws_u is valid.
#> ✔ edges$ws_v is valid.
#> ✔ Table edges is consistent with the schema.
#> ✖ Package's ressources validation failed.
#> ✖ Package validation failed.
Write package
Once the package is ready, we can write it to disk.
write_package(pkg, file.path("~/", pkg$name))