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 params.json when present;

  5. upgrades older package versions when needed;

  6. recomputes derived package properties with update_gldp().

Usage

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

Arguments

x

Path or URL to a GeoLocator-DP datapackage.json file.

force_read

If TRUE (default), loads resource data into memory so the returned object is self-contained in memory. This means that each resource is read immediately with frictionless::read_resource(), cast to the schema types, stored in resource$data, and its path field is removed.

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.

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