write_records: Write records to file

View source: R/write_records.R

write_recordsR Documentation

Write records to file

Description

write_records writes records. Obtain available formats through get_records_drivers. Records can be read through read_records.

Usage

write_records(
  records,
  file = NULL,
  driver = "GeoJSON",
  dir_out = NULL,
  append = FALSE,
  verbose = TRUE,
  ...
)

Arguments

records

data.frame, one or multiple records (each represented by one row), as it is returned by get_records.

file

character file name or file path of file to be saved. If it is a file name it will be written at dir_out in the format of driver. If it is a file path without valid file extension it will be written in the format of driver at the specified path. If it is a file path with valid file extension it will be written there. It can also be a character file name, in this case dir_out has to be provided. If the specified file exists and append == FALSE the file will be overwritten. Check for available drivers and extensions through get_records_drivers.

driver

character specifies the writer. Options are all thise returned by get_records_drivers. Will be ignored in case a fully qualified file path is provided. Default is "GeoJSON".

dir_out

character. If dir_out is not NULL the given cloud mask rasters and a record file for each record will be saved in dir_out. If it is NULL, the session dir_out is used. If no session dir_out is set through set_archive an error is thrown.

append

logical, if TRUE and a file path is given through file, the record(s) will be appended to file if possible.

verbose

logical, if TRUE, details on the function's progress will be visibile on the console. Default is TRUE.

...

further arguments to be passed to sf::st_write.

Value

character file path to saved records.

Author(s)

Henrik Fisser, 2020


16EAGLE/getSpatialData documentation built on June 9, 2022, 11:28 a.m.