50% off | Unlimited Data & AI Learning
Get 50% off unlimited learning

gpkg (version 0.0.12)

gpkg_table_pragma: Lazy Access to Tables by Name

Description

gpkg_table_pragma(): Get information on a table in a GeoPackage (without returning the whole table).

gpkg_table(): Access a specific table (by name) and get a tbl_SQLiteConnection object referencing that table

gpkg_collect(): Alias for gpkg_table(..., collect=TRUE)

gpkg_tbl(): Alias for gpkg_table(..., collect=FALSE)(default) that always returns a tbl_SQLiteConnection object.

gpkg_rast(): Get a SpatRaster object corresponding to the specified table_name

gpkg_vect(): Get a SpatVector object corresponding to the specified table_name

gpkg_sf(): Get a sf-tibble object corresponding to the specified table_name

Usage

gpkg_table_pragma(x, table_name = NULL, ...)

# S3 method for default gpkg_table_pragma(x, table_name = NULL, ...)

gpkg_table( x, table_name, collect = FALSE, column_names = "*", query_string = FALSE, ... )

# S3 method for default gpkg_table( x, table_name, collect = FALSE, column_names = "*", query_string = FALSE, ... )

gpkg_collect(x, table_name, query_string = FALSE, ...)

gpkg_tbl(x, table_name, ...)

gpkg_rast(x, table_name = NULL, ...)

gpkg_vect(x, table_name, ...)

gpkg_sf(x, table_name, ...)

Value

gpkg_table(): A 'dbplyr' object of class tbl_SQLiteConnection

gpkg_collect(): An object of class data.frame

gpkg_tbl(): An object of class tbl_SQLiteConnection

gpkg_rast(): A 'terra' object of class SpatRaster

gpkg_vect(): A 'terra' object of class SpatVector (may not contain geometry columns)

gpkg_sf()): An sf-tibble object of class "sf", "tbl_df". If the table contains no geometry column the result is a "tbl_df".

Arguments

x

A geopackage object or character path to GeoPackage file

table_name

character. One or more table names; for gpkg_table_pragma() if table_name=NULL returns a record for each table. gpkg_table() requires table_name be specified

...

Additional arguments. In gpkg_table() arguments in ... are passed to dplyr::tbl(). For gpkg_table_pragma(), ... arguments are (currently) not used. For gpkg_rast() additional arguments are passed to terra::rast(). For gpkg_vect() additional arguments (such as proxy=TRUE) are passed to terra::vect().

collect

logical. Materialize a data.frame object in memory? Default: FALSE requires 'dbplyr' package. TRUE uses 'RSQLite'.

column_names

character. Used only when collect=TRUE. A character vector of column names to select from table_name.

query_string

logical. Return SQLite query rather than executing it? Default: FALSE