diff --git a/R/api_segments.R b/R/api_segments.R index fb54e8364..f61429305 100755 --- a/R/api_segments.R +++ b/R/api_segments.R @@ -398,9 +398,10 @@ progress) { # how much memory do we need? - req_memory <- .tile_nrows(tile) * .tile_ncols(tile) * - length(.tile_timeline(tile)) * length(bands) * 4 * - .conf("processing_bloat_seg") / 1e+09 + # Get image size + req_memory <- .as_dbl(.tile_nrows(tile)) * .as_dbl(.tile_ncols(tile)) + req_memory <- req_memory * length(.tile_timeline(tile)) * + length(bands) * 4 * .conf("processing_bloat_seg") / 1e+09 # do we have enough memory? if (req_memory < memsize) { diff --git a/R/sits_label_classification.R b/R/sits_label_classification.R index 7e58ec075..64c727851 100644 --- a/R/sits_label_classification.R +++ b/R/sits_label_classification.R @@ -72,8 +72,6 @@ sits_label_classification.probs_cube <- function(cube, ..., progress = TRUE) { # Pre-conditions - Check parameters .check_cube_files(cube) - .check_lgl_parameter(clean) - .check_window_size(window_size = window_size, min = 3, max = 15) .check_memsize(memsize, min = 1, max = 16384) .check_multicores(multicores, min = 1, max = 2048) .check_output_dir(output_dir) @@ -83,10 +81,6 @@ sits_label_classification.probs_cube <- function(cube, ..., # Get block size block <- .raster_file_blocksize(.raster_open_rast(.tile_path(cube))) - # Get image size - image_size <- .raster_size(.raster_open_rast(.tile_path(cube))) - # Overlapping pixels - overlap <- ceiling(window_size / 2) - 1 # Check minimum memory needed to process one block job_memsize <- .jobs_memsize( job_size = .block_size(block = block, overlap = 0), diff --git a/man/sits_cube.Rd b/man/sits_cube.Rd index 55099630d..955bebd34 100644 --- a/man/sits_cube.Rd +++ b/man/sits_cube.Rd @@ -307,7 +307,7 @@ if (sits_run_examples()) { ## Sentinel-1 SAR from MPC roi_sar <- c("lon_min" = -50.410, "lon_max" = -50.379, - "lat_min" = -10.1910, "lat_max" = -10.1573) + "lat_min" = -10.1910, "lat_max" = -10.1573) s1_cube_open <- sits_cube( source = "MPC", @@ -316,7 +316,7 @@ if (sits_run_examples()) { roi = roi_sar, start_date = "2020-06-01", end_date = "2020-09-28" - ) + ) # --- Create a cube based on a local MODIS data data_dir <- system.file("extdata/raster/mod13q1", package = "sits")