Description Usage Arguments Details Value Author(s) See Also Examples
Spiders a directory for raster files.
1 2 3  | 
path | 
 Character. The path to search for raster files.  | 
pattern | 
 Character. A regular expression to limit the files that are tested/returned.  | 
recursive | 
 Logical. Search nested subdirectories within the path?  | 
return_rasters | 
 Logical. Return all proper files as RasterBrick objects (TRUE) or as filenames (FALSE).  | 
return_bbox | 
 Logical. Return a SpatialPolygonsDataFrame with the bounding box geometry and the filenames as data.frame attributes.  | 
bbox_CRS | 
 CRS. If return_bbox==TRUE, the CRS that the output bbox SpatialPolygonsDataFrame should be in.  | 
This function searches through a path (potentially recursively), and returns the filename and/or a brick for each file that can be coerced safely to a RasterBrick object. Note that given different flavors of GDAL, this may return different results for the same directory on different computers. If a foreach parallel backend has been registered, the spidering will use parallel processing to check each file, potentially speeding it up.
A list of filenames (return_rasters=FALSE) or a list of RasterBricks (return_rasters=TRUE) and/or a SpatialPolygonsDataFrame of the bounding boxes (return_bbox==TRUE).
Jonathan A. Greenberg
1 2 3 4 5 6 7  | {
search_folder <- system.file("external/", package="spatial.tools")
# sfQuickInit() # To potentially speed the search up.
list.raster.files(path=search_folder)
list.raster.files(path=search_folder,return_rasters=TRUE)
# sfQuickStop()
}
 | 
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.