The goal of rgeopackage is to support reading and writing metadata associated with GeoPackage (gpkg) files and assist in writing reproducible GeoPackage files more broadly.
You can install the development version of rgeopackage from GitHub with:
# install.packages("devtools")
devtools::install_github("r-spatial/rgeopackage")
rgeopackage uses the RSQLite package and
the glue::glue_sql()
to use SQL statements to read and write
non-spatial data to any table within a GeoPackage file.
read_gpkg_contents()
returns a dataframe with the “gpkg_contents” table.read_gpkg_metadata()
andread_gpkg_schema()
return a list with the related tables for the corresponding GeoPackage extension.
preset_timestamp()
: presets the file timestamp for usage by GDAL by setting the environment variableOGR_CURRENT_DATE
. The timestamp is adopted by GDAL during the entire session, unlessunset_timestamp()
is called.amend_timestamp()
: overwrites timestamps in thegpkg_contents
andgpkg_metadata_reference
tables of an existing GeoPackage file.
By default, GDAL sets timestamps corresponding to system time, so
GeoPackages change when rewriting. Both functions accept a Date
or
POSIXct
object and use standard formatting for GeoPackage files.
This package also includes reference tables for GeoPackage extensions
(both registered gpkg_extensions
and community
community_gpkg_extensions
).
-
The sf package allows users to set GDAL configuration options in
sf::st_write()
using theconfig_options
argument (see sf issue #1618) and insf::st_read()
using theoptions
argument (see sf issue 1157). sf also includes a set of GDAL functions (e.g.sf::gdal_metadata()
) that are not intended to be called directly by the user but could be used to access and edit GeoPackage metadata. -
The vapour package provides access to the basic read functions available in GDAL including GeoPackage contents and extension tables.