portfolio {mapme.biodiversity}R Documentation

Writing a portfolio to disk

Description

write_portfolio() writes a processed biodiversity portfolio to disk. In order to ensure interoperability with other geospatial software the only supported format is the GeoPackage. The metadata of a portfolio together with the geometry will be written to a table called 'metadata'. All calculated indicators, which are expected to be present as nested list columns, will be written to their own respective tables. In order to allow re-joining the metadata with the indicators, it is expected that a column called 'assetid' which uniquely identifies all assets is present. Usually, users do not have to take care of this since the usual mapme.biodiversity workflow will ensure that this columns is present. Additional arguments to st_write() can be supplied.

read_portfolio() is used to read a portfolio object that was previously written to disk via write_portfolio() back into R as an sf object. It should be directed against a GeoPackage which was the output of write_portfolio(), otherwise the function is very likely to fail. All available indicators will be read back into R as nested list columns reflecting the output once calc_indicators() has been called.

Usage

write_portfolio(x, dsn, overwrite = FALSE, ...)

read_portfolio(src, ...)

Arguments

x

A portfolio object processed with mapme.biodiversity

dsn

A file path for the output file. Should end with '.gpkg'

overwrite

A logical indicating if the output file should be overwritten if it exists

...

Additional arguments supplied to st_read()

src

A character vector pointing to a GeoPackage that has been previously written to disk via write_portfolio()

Value

write_portfolio() returns x, invisibly.

read_portfolio() reutnrs an sf object object with nested list columns for every indicator table found in the GeoPackage source file.


[Package mapme.biodiversity version 0.6.0 Index]