gdalUtils (version 0.2.0)

mosaic_rasters: Mosaic raster files using GDAL Utilities

Description

Mosaic raster files using GDAL Utilities

Usage

mosaic_rasters(gdalfile, dst_dataset, output.vrt = NULL,
  output_Raster = FALSE, ...)

Arguments

gdalfile
Character. Input files (as a character vector) or a wildcard search term (e.g. "*.tif")
dst_dataset
Character. The destination file name.
output.vrt
Character. Output VRT file. If NULL a temporary .vrt file will be created.
output_Raster
Logical. Return output dst_dataset as a RasterBrick?
...
Parameters to pass to gdalbuildvrt and gdal_translate.

Value

  • Either a list of NULLs or a list of RasterBricks depending on whether output_Raster is set to TRUE.

Details

This function mosaics a set of input rasters (gdalfile) using parameters found in gdalbuildvrt and subsequently exports the mosaic to an output file (dst_dataset) using parameters found in gdal_translate. The user can choose to preserve the intermediate output.vrt file, but in general this is not needed.

See Also

gdalbuildvrt, gdal_translate

Examples

Run this code
layer1 <- system.file("external/tahoe_lidar_bareearth.tif", package="gdalUtils")
layer2 <- system.file("external/tahoe_lidar_highesthit.tif", package="gdalUtils")
mosaic_rasters(gdalfile=c(layer1,layer2),dst_dataset="test_mosaic.envi",separate=TRUE,of="ENVI",
		verbose=TRUE)
gdalinfo("test_mosaic.envi")

Run the code above in your browser using DataLab