add_images

Add images to an existing image collection

Description

This function adds provided files or GDAL dataset identifiers and to an existing image collection by extracting datetime, image identifiers, and band information according to the collection’s format.

Usage

add_images(
  image_collection,
  files,
  unroll_archives = TRUE,
  out_file = "",
  quiet = FALSE
)

Arguments

Argument Description
image_collection image_collection object or path to an existing collection file
files character vector with paths to image files on disk or any GDAL dataset identifiers (including virtual file systems and higher level drivers or GDAL subdatasets)
unroll_archives automatically convert .zip, .tar archives and .gz compressed files to GDAL virtual file system dataset identifiers (e.g. by prepending /vsizip/) and add contained files to the list of considered files
out_file path to output file, an empty string (the default) will update the collection in-place, whereas images will be added to a new copy of the image collection at the given location otherwise.
quiet logical; if TRUE, do not print resulting image collection if return value is not assigned to a variable

Value

image collection proxy object, which can be used to create a data cube using raster_cube

Examples

L8_files <- list.files(system.file("L8NY18", package = "gdalcubes"),
                         ".TIF", recursive = TRUE, full.names = TRUE)
L8_col = create_image_collection(L8_files[1:12], "L8_L1TP") 
add_images(L8_col, L8_files[13:24])
Image collection object, referencing 2 images with 12 bands
Images:
                                      name      left      top   bottom
1 LC08_L1TP_013032_20180131_20180207_01_T1 -74.67898 41.39099 39.25027
2 LC08_L1TP_013032_20180405_20180417_01_T1 -74.70333 41.39106 39.25080
      right            datetime        srs
1 -71.92546 2018-01-31T00:00:00 EPSG:32618
2 -71.94695 2018-04-05T00:00:00 EPSG:32618

Bands:
   name offset scale unit   nodata image_count
1   B01      0     1      0.000000           2
2   B02      0     1      0.000000           2
3   B03      0     1      0.000000           2
4   B04      0     1      0.000000           2
5   B05      0     1      0.000000           2
6   B06      0     1      0.000000           2
7   B07      0     1      0.000000           2
8   B08      0     1      0.000000           2
9   B09      0     1      0.000000           2
10  B10      0     1      0.000000           2
11  B11      0     1      0.000000           2
12  BQA      0     1                         2