Read a local or remote datapackage.json and build a geolocatordp object.
The function:
reads the package descriptor with
frictionless::read_package();checks that it uses the GeoLocator-DP profile schema;
optionally loads resource tables into memory;
reads the GeoPressureR parameters into
pkg$params, from the file of theparamsresource or elseparams.jsonwhen present, in plain JSON (seewrite_gldp()for what JSON keeps) or in thejsonlite::serializeJSON()format written by GeoLocatoR < 1.5.0;upgrades older package versions when needed;
recomputes derived package properties with
update_gldp().
Upgrading a package older than GeoLocator-DP v1.3 converts the SOI magnetic
and acceleration x/y stored by GeoPressureR < 3.8.0 to the forward-right-down
frame of v1.3, when the params of the tag record the mapping that was
applied. Tags whose frame is unknown are left as stored, with a warning. It
also recomputes the groundspeed of simulated edges that GeoPressureR 3.2.0
to 3.7.0 took from another flight, and removes their wind, for the tags whose
params record one of these versions.
When present, the datapackages provenance catalogue is restored as a tibble,
with one row per source package, as returned by merge_gldp().
Arguments
- x
Path to a GeoLocator-DP package directory or
datapackage.jsonfile, or a URL todatapackage.json.- force_read
If
TRUE(default), loads resource data into memory so the returned object is self-contained in memory. This means that each table is read immediately withfrictionless::read_resource(), cast to the schema types, stored inresource$data, and itspathfield is removed. Themeasurementsresource is read last, and resources without a table schema keep theirpath. Some tables are loaded even whenFALSE, because their upgrade changes values and cannot operate on file paths alone: every table of a package older than GeoLocator-DP v1.0,pressurepathsandobservationsof a v1.0 or v1.1 package, andmeasurementsandedgesof a package older than v1.3 whose SOI axes or groundspeeds are repaired.- drop_measurements
If
TRUE, drops themeasurementsresource after readingdatapackage.jsonand before the optionalforce_readstep loads resource data into memory. Use this to save memory and avoid slowdowns when working mainly with derived GeoPressure resources such asstaps,paths,edges, orpressurepaths.temporalthen keeps the value indatapackage.json, the measurement counts innumberTagsare left out, andtaxonomiclists the species of every tag.
See also
create_gldp() to create a new package shell, write_gldp() to
write a package to disk, and read_zenodo() to read a package from Zenodo.
Examples
if (FALSE) { # \dontrun{
# Read a local package
pkg <- read_gldp("datapackage.json")
# Read a remote package
pkg_remote <- read_gldp("https://example.org/datapackage.json")
# Keep resource paths instead of loading all tables into memory
pkg_lazy <- read_gldp("datapackage.json", force_read = FALSE)
# Skip the measurements table to reduce memory use
pkg_light <- read_gldp("datapackage.json", drop_measurements = TRUE)
} # }
