From c9474c062f0ee6ef3542d29f70f9341474a210de Mon Sep 17 00:00:00 2001 From: Rolf Simoes Date: Thu, 23 Sep 2021 18:21:29 -0300 Subject: [PATCH 1/3] Fix #376 --- R/sits_bbox.R | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/R/sits_bbox.R b/R/sits_bbox.R index 495a457fb..eb14aac8d 100644 --- a/R/sits_bbox.R +++ b/R/sits_bbox.R @@ -50,29 +50,33 @@ sits_bbox.cube <- function(data, wgs84 = FALSE, ...) { # create and return the bounding box if (nrow(data) == 1) { - bbox <- c(data$xmin, data$xmax, data$ymin, data$ymax) + bbox <- c(xmin = data$xmin, + xmax = data$xmax, + ymin = data$ymin, + ymax = data$ymax) } else { - bbox <- c(min(data$xmin), max(data$xmax), - min(data$ymin), max(data$ymax) + bbox <- c(xmin = min(data$xmin), + xmax = max(data$xmax), + ymin = min(data$ymin), + ymax = max(data$ymax) ) } - names(bbox) <- c("xmin", "xmax", "ymin", "ymax") - - # convert to WGS84? if (wgs84) { bbox <- c( .sits_proj_to_latlong(x = bbox[["xmin"]], y = bbox[["ymin"]], - crs = data$crs), + crs = data$crs[[1]]), .sits_proj_to_latlong(x = bbox[["xmax"]], y = bbox[["ymax"]], - crs = data$crs) + crs = data$crs[[1]]) ) - names(bbox) <- c("lon_min", "lon_max", "lat_min", "lat_max") + names(bbox) <- c("lon_min", "lat_min", "lon_max", "lat_max") + + bbox <- bbox[c("lon_min", "lon_max", "lat_min", "lat_max")] } return(bbox) From c0441fe7b2f74f0b09731af5a423781c8c20be71 Mon Sep 17 00:00:00 2001 From: Rolf Simoes Date: Thu, 23 Sep 2021 18:51:28 -0300 Subject: [PATCH 2/3] update hotfix version --- DESCRIPTION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DESCRIPTION b/DESCRIPTION index 0832c6997..66f8795ec 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: sits Type: Package -Version: 0.14.0-1 +Version: 0.14.0-2 Title: Satellite Image Time Series Analysis for Remote Sensing 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.br'), From d78acc7d29d7bdf610742849e52b8427c689a4de Mon Sep 17 00:00:00 2001 From: Rolf Simoes Date: Thu, 23 Sep 2021 18:51:59 -0300 Subject: [PATCH 3/3] update NEWS --- NEWS.md | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/NEWS.md b/NEWS.md index 3969d3ecd..02352a30f 100644 --- a/NEWS.md +++ b/NEWS.md @@ -3,14 +3,16 @@ We are preparing to release the package on CRAN and are making relevant changes in the development version. -# What's new in SITS version 0.14.0-1 +# What's new in SITS version 0.14.0 + +### New features in SITS version 0.14.0-2 + +* fix `sits_bbox()` function ### New features in SITS version 0.14.0-1 * fix duplicate link in AWS STAC -# What's new in SITS version 0.14.0 - ### New features in SITS version 0.14.0 * Now the plot of a classified cube requires a legend or a palette if the labels are not in the default sits palette.