You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
28 lines
572 B
R
28 lines
572 B
R
#rm(list=ls())
|
|
|
|
|
|
# ------------------------ Libraries ------------------------
|
|
|
|
library(raster)
|
|
|
|
# ------------------------ Function definition ------------------------
|
|
deleteWater <- function(Image,water){
|
|
|
|
# ------------------------ Loading Bands ------------------------
|
|
##
|
|
burnedArea <- Image
|
|
water <- water
|
|
|
|
|
|
# Bands
|
|
water <- reclassify(water, c( -Inf , 0, 0,
|
|
0 , Inf , 1 ))
|
|
|
|
output <- burnedArea
|
|
output[water == 1] <- NA
|
|
|
|
# ------------------------ Output ------------------------ #
|
|
return(output)
|
|
}
|
|
|