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
params.jsonwhen present;upgrades older package versions when needed;
recomputes derived package properties with
update_gldp().
Arguments
- x
Path or URL to a GeoLocator-DP
datapackage.jsonfile.- 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 withfrictionless::read_resource(), cast to the schema types, stored inresource$data, and itspathfield is removed.- 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.
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)
} # }
