Commit 6f04501a authored by Romulo Pereira Goncalves's avatar Romulo Pereira Goncalves
Browse files

Merge branch 'issue#27' into 'master'

fixes issue#27

Closes #27

See merge request !16
parents d2a87c9a e4537dae
Pipeline #24378 passed with stages
in 10 minutes and 27 seconds
......@@ -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
......
......@@ -13,22 +13,22 @@
#' @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.")
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment