diff --git a/DESCRIPTION b/DESCRIPTION index 0d6d4c7d9..51264e84a 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: sits Type: Package -Version: 1.5.1 +Version: 1.5.0-1 Title: Satellite Image Time Series Analysis for Earth Observation Data Cubes Authors@R: c(person('Rolf', 'Simoes', role = c('aut'), email = 'rolf.simoes@inpe.br'), person('Gilberto', 'Camara', role = c('aut', 'cre'), email = 'gilberto.camara.inpe@gmail.com'), @@ -17,7 +17,7 @@ Description: An end-to-end toolkit for land use and land cover classification applied to satellite image data cubes, as described in Simoes et al (2021) . Builds regular data cubes from collections in AWS, Microsoft Planetary Computer, Brazil Data Cube, and Digital Earth Africa using the Spatio-temporal Asset Catalog (STAC) - protocol ( and the 'gdalcubes' R package + protocol () and the 'gdalcubes' R package developed by Appel and Pebesma (2019) . Supports visualization methods for images and time series and smoothing filters for dealing with noisy time series. diff --git a/NAMESPACE b/NAMESPACE index 3be96dac8..9f7e1f11d 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -337,9 +337,6 @@ S3method(sits_cube,default) S3method(sits_cube,local_cube) S3method(sits_cube,sar_cube) S3method(sits_cube,stac_cube) -S3method(sits_detect_change,default) -S3method(sits_detect_change,raster_cube) -S3method(sits_detect_change,sits) S3method(sits_get_data,csv) S3method(sits_get_data,data.frame) S3method(sits_get_data,default) @@ -443,9 +440,6 @@ export(sits_config) export(sits_config_show) export(sits_cube) export(sits_cube_copy) -export(sits_detect_change) -export(sits_detect_change_method) -export(sits_dtw) export(sits_factory_function) export(sits_filter) export(sits_formula_linear) diff --git a/NEWS.md b/NEWS.md index 5b6ba7d4b..7fb6ccfa2 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,6 +1,16 @@ # SITS Release History # What's new in SITS version 1.5 + +### Hotfix version 1.5.0-1 +* Remove tapply from `.reg_cube_split_assets()` for R 4.X compatibility +* Fix `sits_merge()` function that was not merging `SAR` and `OPTICAL` cubes +* Rename n_input_pixels back to input_pixels for compatibility with models trained in old versions of the package +* Fix torch usage in Apple M3 by turning off MPS technology +* Fix date parameter usage in `sits_view()` +* Improve `plot()` performance using raster overviews +* Include support for PLANET Mosaic product + ### New features in SITS version 1.5.0 * Support for SENTINEL-1-RTC and SENTINEL-2-L2A in CDSE * Include support for DEA products SENTINEL-1-RTC, LS5-SR, LS7-SR, LS9-SR, ALOS-PALSAR-MOSAIC, NDVI ANOMALY, DAILY CHIRPS, MONTHLY CHIRPS and DEM-30 diff --git a/R/api_detect_changes.R b/R/api_detect_changes.R index 7602d9b49..0fc96a293 100644 --- a/R/api_detect_changes.R +++ b/R/api_detect_changes.R @@ -143,7 +143,7 @@ # Fill with zeros remaining NA pixels values <- C_fill_na(values, 0) # Used to check values (below) - n_input_pixels <- nrow(values) + input_pixels <- nrow(values) # Include names in cube predictors colnames(values) <- .pred_features_name( .ml_bands(cd_method), tile_timeline @@ -163,7 +163,7 @@ # Are the results consistent with the data input? .check_processed_values( values = values, - n_input_pixels = n_input_pixels + input_pixels = input_pixels ) # Log here .debug_log( diff --git a/R/api_regularize.R b/R/api_regularize.R index 6f6eb6d62..068ec1622 100644 --- a/R/api_regularize.R +++ b/R/api_regularize.R @@ -42,7 +42,7 @@ breaks = timeline, labels = FALSE ) - fi_groups <- unname(tapply(fi, groups, list)) + fi_groups <- unname(split(fi, groups)) assets <- .common_size( .discard(tile, "file_info"), feature = timeline[unique(groups)], diff --git a/R/sits_detect_change.R b/R/sits_detect_change.R index 6cf1a8b3e..9bf7ffa0a 100644 --- a/R/sits_detect_change.R +++ b/R/sits_detect_change.R @@ -38,7 +38,6 @@ #' each point (tibble of class "sits") #' or a data cube indicating detections in each pixel #' (tibble of class "detections_cube"). -#' @export sits_detect_change <- function(data, cd_method, ..., @@ -49,7 +48,6 @@ sits_detect_change <- function(data, } #' @rdname sits_detect_change -#' @export sits_detect_change.sits <- function(data, cd_method, ..., @@ -74,7 +72,6 @@ sits_detect_change.sits <- function(data, } #' @rdname sits_detect_change -#' @export sits_detect_change.raster_cube <- function(data, cd_method, ..., roi = NULL, @@ -180,7 +177,6 @@ sits_detect_change.raster_cube <- function(data, } #' @rdname sits_detect_change -#' @export sits_detect_change.default <- function(data, cd_method, ...) { stop("Input should be a sits tibble or a data cube") } diff --git a/R/sits_detect_change_method.R b/R/sits_detect_change_method.R index b27c0230e..e92cb843b 100644 --- a/R/sits_detect_change_method.R +++ b/R/sits_detect_change_method.R @@ -12,8 +12,6 @@ #' @return Change detection method prepared #' to be passed to #' \code{\link[sits]{sits_detect_change}} -#' @export -#' sits_detect_change_method <- function(samples, cd_method = sits_dtw()) { # set caller to show in errors .check_set_caller("sits_detect_change_method") diff --git a/R/sits_dtw.R b/R/sits_dtw.R index 34d0480c8..18617381f 100644 --- a/R/sits_dtw.R +++ b/R/sits_dtw.R @@ -19,8 +19,6 @@ #' used in operations with data cubes. #' @return Change detection method prepared to be passed to #' \code{\link[sits]{sits_detect_change_method}} -#' @export -#' sits_dtw <- function(samples = NULL, ..., diff --git a/R/sits_merge.R b/R/sits_merge.R index 7598d881b..dd4b6c137 100644 --- a/R/sits_merge.R +++ b/R/sits_merge.R @@ -132,10 +132,10 @@ sits_merge.raster_cube <- function(data1, data2, ...) { .data[["tile"]] ) - if (inherits(data2, "raster_cube")) { - return(.merge_equal_cube(data1, data2)) - } else { + if (inherits(data2, "sar_cube")) { return(.merge_distinct_cube(data1, data2)) + } else { + return(.merge_equal_cube(data1, data2)) } } @@ -152,8 +152,8 @@ sits_merge.raster_cube <- function(data1, data2, ...) { .merge_distinct_cube <- function(data1, data2) { # Get cubes timeline - d1_tl <- unique(as.Date(unlist(.cube_timeline(data1)))) - d2_tl <- unique(as.Date(unlist(.cube_timeline(data2)))) + d1_tl <- unique(as.Date(.cube_timeline(data1)[[1]])) + d2_tl <- unique(as.Date(.cube_timeline(data2)[[1]])) # get intervals d1_period <- as.numeric( diff --git a/inst/extdata/sources/config_source_planet.yaml b/inst/extdata/sources/config_source_planet.yaml new file mode 100644 index 000000000..1d49df023 --- /dev/null +++ b/inst/extdata/sources/config_source_planet.yaml @@ -0,0 +1,30 @@ +sources: + PLANET : + s3_class : ["planet_cube", "stac_cube", "eo_cube", + "raster_cube"] + collections : + MOSAIC : + bands : + B01 : &planet_mosaic_4m + missing_value : 0 + minimum_value : 1 + maximum_value : 65534 + scale_factor : 0.01 + offset_value : 0 + resolution : 4.77 + band_name : "blue" + data_type : "INT2U" + B02 : + <<: *planet_mosaic_4m + band_name : "green" + B03 : + <<: *planet_mosaic_4m + band_name : "red" + B04 : + <<: *planet_mosaic_4m + band_name : "nir" + satellite : "PLANETSCOPE" + sensor : "MOSAIC" + collection_name: "planet-mosaic" + ext_tolerance: 0 + grid_system : ""