pkgdown/analytics.html Skip to contents

Read a local or remote datapackage.json and build a geolocatordp object. The function:

  1. reads the package descriptor with frictionless::read_package();

  2. checks that it uses the GeoLocator-DP profile schema;

  3. optionally loads resource tables into memory;

  4. reads the GeoPressureR parameters into pkg$params, from the file of the params resource or else params.json when present, in plain JSON (see write_gldp() for what JSON keeps) or in the jsonlite::serializeJSON() format written by GeoLocatoR < 1.5.0;

  5. upgrades older package versions when needed;

  6. 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().

Usage

read_gldp(x = "datapackage.json", force_read = TRUE, drop_measurements = FALSE)

Arguments

x

Path to a GeoLocator-DP package directory or datapackage.json file, or a URL to datapackage.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 with frictionless::read_resource(), cast to the schema types, stored in resource$data, and its path field is removed. The measurements resource is read last, and resources without a table schema keep their path. Some tables are loaded even when FALSE, because their upgrade changes values and cannot operate on file paths alone: every table of a package older than GeoLocator-DP v1.0, pressurepaths and observations of a v1.0 or v1.1 package, and measurements and edges of a package older than v1.3 whose SOI axes or groundspeeds are repaired.

drop_measurements

[Experimental] If TRUE, drops the measurements resource after reading datapackage.json and before the optional force_read step loads resource data into memory. Use this to save memory and avoid slowdowns when working mainly with derived GeoPressure resources such as staps, paths, edges, or pressurepaths. temporal then keeps the value in datapackage.json, the measurement counts in numberTags are left out, and taxonomic lists the species of every tag.

Value

A geolocatordp object.

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)
} # }