From 5e126a5e7bf012ad8be30b24268dc73aac7669eb Mon Sep 17 00:00:00 2001 From: Johannes Knoch Date: Thu, 10 Jun 2021 19:28:59 +0200 Subject: [PATCH 1/2] checks now only for .tif files which begin with step_*; no longer generate kmz files, but the unzipped version consisting of a kml and a png because plot_results.r checks now for png and no longer for kmz --- R-package/R/outer_procedure.r | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/R-package/R/outer_procedure.r b/R-package/R/outer_procedure.r index be25be4..ebb2dd7 100644 --- a/R-package/R/outer_procedure.r +++ b/R-package/R/outer_procedure.r @@ -92,17 +92,17 @@ multi_Class_Sampling <- function(in.raster, max_num_cores = 5, plot_on_browser = TRUE) { - # Checks if its a new or a resumed run and asks the user to remove all .tif + # Checks if its a new or a resumed run and asks the user to remove all step_*.tif # files from the results folder in case of a new run. if(step == 1){ if (length(list.files( outPath, - pattern = ".tif$", + pattern = "step_(.*).tif", all.files = FALSE, include.dirs = TRUE, no.. = TRUE )) != 0) { - message("Remove all .tif files from the Results directory! Don't forget to save them and the other files. + message("Remove all step_*.tif files from the Results directory! Don't forget to save them and the other files. All other files will be overwriten when a new sampling is started.") return(NULL) } @@ -518,7 +518,7 @@ multi_Class_Sampling <- function(in.raster, kml <- raster::projectRaster(dummy, crs = "+proj=longlat +datum=WGS84", method = 'ngb') - raster::KML(kml, paste(outPath, paste("step_", ni, sep = ""), sep = ""), overwrite = overwrite) + raster::KML(kml, paste(outPath, paste("step_", ni, sep = ""), sep = ""), overwrite = overwrite, zip = FALSE) thres <- as.numeric(decision) thres <- thres + num_models -- GitLab From e4537dae518a6f6e3c2576d8e327d46833f0409a Mon Sep 17 00:00:00 2001 From: Johannes Knoch Date: Thu, 10 Jun 2021 19:31:15 +0200 Subject: [PATCH 2/2] checks now only for .tif files which begin with step_* and compares them to the .png files; message for the user adjusted --- R-package/R/plot_results.r | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/R-package/R/plot_results.r b/R-package/R/plot_results.r index 207d2a1..323fa2b 100644 --- a/R-package/R/plot_results.r +++ b/R-package/R/plot_results.r @@ -12,23 +12,23 @@ #' #' @export plot_results <- function(inPath, color = NULL) { - - # Compares the number of .kmz to that of .tif. If .tif files are missing the + + # Compares the number of .png to that of step_*.tif. If step_*.tif files are missing the # user's attention is drawn. if (length(list.files( inPath, - pattern = ".tif$", + pattern = "step_(.*).tif", all.files = FALSE, include.dirs = TRUE, no.. = TRUE )) != length(list.files( inPath, - pattern = ".kmz$", + pattern = ".png$", all.files = FALSE, include.dirs = TRUE, no.. = TRUE ))) { - message("Make sure the number of the .tif files fits to the number of the .kmz files and that + message("Make sure the number of the step_*.tif files fits to the number of the .png files and that there are no other files from previous runs. If you have resumed a run, then the data of the aborted and the continued run needs to be in the Results directory. You need them for plotting the classification map.") -- GitLab