You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Title: Automated Cloud Masking for Landsat MSS Images
3
4
Version: 1.0.0
4
5
Date: 2015-07-23
5
6
Authors@R: c(person("Justin", "Braaten", email = "jstnbraaten@gmail.com", role = c("aut", "cre")),
6
7
person("Warren", "Cohen", email = "warren.cohen@oregonstate.edu", role = "aut"),
7
8
person("Zhiqiang", "Yang", email = "zhiqiang.yang@oregonstate.edu", role = "aut"))
8
-
Description: An automated cloud and cloud shadow masking system for Landsat MSS imagery. It allows MSS imagery to more easily be used in large-area and time series analysis by providing an efficent way to prevent cloud and cloud shadow pixels from contaminating mosaics, composites, and time series.
9
+
Description: An automated cloud and cloud shadow masking system for Landsat MSS imagery. It provides a means of more easily incorporating MSS imagery in large-area and time series analysis by providing an efficient way to prevent cloud and cloud shadow pixels from contaminating mosaics, composites, and time series.
ref=raster::raster(imgfile) #read in the MSS file for information on image extent and as a template for holding values later
42
45
dem=raster::raster(demFile) #read in the DEM file - raster package function
43
46
demproj=raster::projection(dem)
44
47
imgproj=raster::projection(ref)
48
+
demres=raster::xres(dem)
49
+
imgres=raster::xres(ref)
50
+
51
+
#check to make the DEM and image resolutions are the same
52
+
if(demres!=imgres){
53
+
print(paste("The DEM file:",demFile,"does not have the same pixel resolution as the image file."))
54
+
print("Please make sure the DEM file has the same pixel resolution as the image file. Use the function 'reprojectDEM' to assist in getting it in the same resolution")
55
+
stop("Stopping MSScvm")
56
+
}
45
57
46
58
#check to make the DEM and image projections are the same
Copy file name to clipboardExpand all lines: R/mosaicDEMs.r
+20-13Lines changed: 20 additions & 13 deletions
Original file line number
Diff line number
Diff line change
@@ -3,10 +3,11 @@
3
3
#' A helper function to create the large-extent DEM file required by the 'MSScvm' function.
4
4
#' @param dir directory name (character). Full path to a directory containing digital elevation model (DEM) files to be mosaiced.
5
5
#' @param projRef filename (character). Full path to an image file produced by the \code{\link{MSSunpack}} function.
6
-
#' @param NAvalue numeric. What is the background value of the DEM files in the directory.
6
+
#' @param srcNodata numeric. What is the background value of the DEM files in the directory. If there is no background value, use NA (default)
7
+
#' @param dstNodata numeric. Specify the value to represent background pixels in the mosaic DEM. -32768 is the default
7
8
#' @details The provided directory path should only contain decompressed digital elevation files from the same source (SRTM, NED, GTOPO, etc).
8
9
#' The function will search the directory and include all files found in the mosaic. It is important that each file have the same background value
9
-
#' and that it is correctly assigned to the 'NAvalue' parameter, if not, intersection between DEMs could have unexpected results.
10
+
#' and that it is correctly assigned to the 'srcNodata' parameter, if not, intersection between DEMs could have unexpected results.
10
11
#' Each individual DEM file will be adjusted to match the projection and pixel resolution of the 'proRef' image.
11
12
#' Then they will be merged using the mean value of intersecting pixels.
12
13
#' @return A GeoTIFF raster file representing the union of all individual DEM files found in the provided directory path. The mosaic file will be written to the
0 commit comments