Commit 7d08de50 authored by Romulo Pereira Goncalves's avatar Romulo Pereira Goncalves
Browse files

Remove prints.

parent ea81cedd
...@@ -91,19 +91,15 @@ saveSamplePoints <- ...@@ -91,19 +91,15 @@ saveSamplePoints <-
dummy_raster[dummy_raster == num_models] <- NA dummy_raster[dummy_raster == num_models] <- NA
dummy_raster[dummy_raster > num_models] <- 1 dummy_raster[dummy_raster > num_models] <- 1
print("1")
###extract only class samples ###extract only class samples
for (i in 1:length(ref_samples)) { for (i in 1:length(ref_samples)) {
if (length(dim(ref_samples[[i]])) != 0) if (length(dim(ref_samples[[i]])) != 0)
{ {
print("1a")
if (is.na(ref_switch[i]) == F) { if (is.na(ref_switch[i]) == F) {
print("1b")
j = j + 1 j = j + 1
collect[[j]] <- collect[[j]] <-
ref_samples[[i]][which(ref_samples[[i]]@data == 1), ] ref_samples[[i]][which(ref_samples[[i]]@data == 1), ]
} else { } else {
print("1c")
j = j + 1 j = j + 1
collect[[j]] <- collect[[j]] <-
ref_samples[[i]][which(ref_samples[[i]]@data == 2), ] ref_samples[[i]][which(ref_samples[[i]]@data == 2), ]
...@@ -111,24 +107,18 @@ saveSamplePoints <- ...@@ -111,24 +107,18 @@ saveSamplePoints <-
} }
} }
print("2")
result <- do.call(rbind, collect) result <- do.call(rbind, collect)
if (!is.null(result)) { if (!is.null(result)) {
print("3a")
res <- raster::extract(dummy_raster, result) res <- raster::extract(dummy_raster, result)
if (length(which(is.na(res))) > 0) { if (length(which(is.na(res))) > 0) {
print("3aa")
result <- result[-which(is.na(res)), ] result <- result[-which(is.na(res)), ]
} }
} else { } else {
print("3b")
result <- result <-
sp::SpatialPolygonsDataFrame(Sr = sp::SpatialPolygons(list()), data = data.frame()) sp::SpatialPolygonsDataFrame(Sr = sp::SpatialPolygons(list()), data = data.frame())
} }
print("4")
raster::crs(result) <- raster::crs(dummy_raster) raster::crs(result) <- raster::crs(dummy_raster)
print("5")
output_format <- match.arg(output_format) output_format <- match.arg(output_format)
if (output_format == "geojson") { if (output_format == "geojson") {
file_path <- paste(in_path, "SamplePoints_step_", step, "_", class_name, ".geojson", sep = "") file_path <- paste(in_path, "SamplePoints_step_", step, "_", class_name, ".geojson", sep = "")
......
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