save_gpkg: Save the vector format geospatial object of the 'SDM_area' to...

View source: R/save_gpkg.R

save_gpkgR Documentation

Save the vector format geospatial object of the SDM_area to a geopackage file.

Description

Save the vector format geospatial object of the SDM_area to a geopackage file.

Usage

save_gpkg(an_area = NULL, new_name = NULL, dir_path = NULL)

Arguments

an_area

A SDM_area object representing the area of the study.

file_name

The name of file which the sp object will be saved. It can be composed by the file name and the file path. If the file path doesn't exists it will be created. If the file name parameter is equal to NULL, it is replaced by a name computed based on attributes of the SDM_area object.

file_path

The path in which the file will be saved. If file_name contains file path, the file_path parameter is ignored.

Examples

## Not run: 
SPDF <- readOGR(
   system.file("vect_files/brasil_uf.gpkg", package="sdmTools"),
   layer = "brasil_uf",
   verbose = F
)

gridded_area <- SPDF %>%
 sdm_area("Test area", "EPSG:6933", c(50000, 50000)) %>%
 make_grid(var_names = list(), new_name = T)

tmp_dir <- tempdir()

gridded_area %>%
   save_gpkg(file_path = tmp_dir)

tmp_dir %>%
   paste0("/test_area_grid_50000_epsg_6933.gpkg") %>%
   file_info()

## End(Not run)

reginaldo-re/sdmTools documentation built on April 25, 2022, 8:08 p.m.