Skip to contents

Save the geolayer (geographic information layer) and the variables layer in a file in GeoPackage format to be able to work with other tools.

Usage

as_GeoPackage(gl, dir, name, keep_all_variables_na)

# S3 method for geolayer
as_GeoPackage(gl, dir = NULL, name = NULL, keep_all_variables_na = FALSE)

Arguments

gl

A geolayer object.

dir

A string.

name

A string, file name.

keep_all_variables_na

A boolean, keep rows with all variables NA.

Value

A string, file name.

Details

If the file name is not indicated, it defaults to the name of the geovariable.

By default, rows that are NA for all variables are eliminated.

The GeoPackage format only allows defining a maximum of 1998 columns. If the number of variables and columns in the geographic layer exceeds this number, it cannot be saved in this format.

Examples


gl <- mrs_db_geo |>
  as_geolayer()

f <- gl |>
  as_GeoPackage(dir = tempdir())