require(sits.validate)
newraster <- getTifFiles("classificacoes-agregado")[1] %>%
getEmptyRaster
urbanFiles <- getTifFiles("urban/rasters")
for(urban in urbanFiles){
cat(paste0("Processing '", basename(urban), "'\n"))
myurban <- raster::raster(urban)
outputname <- baseDir(paste0("masks/", basename(urban)))
raster::resample(myurban, newraster, method = "ngb", filename = outputname)
}
# copy 2013 to 2014 and 2015 as there is no available data for such years
inputname <- baseDir("masks/urban_areas_2013.tif")
for(year in c(2014, 2015)){
outputname <- baseDir(paste0("masks/urban_areas_", year, ".tif"))
cat(paste0("Copying '", basename(outputname), "'\n"))
file.copy(inputname, outputname, overwrite = TRUE)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.