diff --git a/.Rbuildignore b/.Rbuildignore index 9ecf04a2..9a20617a 100644 --- a/.Rbuildignore +++ b/.Rbuildignore @@ -30,3 +30,4 @@ ^\.github$ ^doc$ ^Meta$ +^CRAN-SUBMISSION$ diff --git a/.gitignore b/.gitignore index 67eb4f38..461869e7 100644 --- a/.gitignore +++ b/.gitignore @@ -16,6 +16,7 @@ inst/testdata/MODIStsp_2018-01-04\.json libs/ _main\.Rmd inst/ExtData/Previous/MODIStsp_Previous\.json +inst/ExtData/MODIStsp_ProdOpts\.RData$ inst/testdata/MODIStsp_2018-02-18\.json inst/testdata/MODIStsp_Previous\.json inst/ExtData/modis_sinusoidal_grid_world\.dbf diff --git a/DESCRIPTION b/DESCRIPTION index c7a73a52..57d6a7f7 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -2,7 +2,7 @@ Package: MODIStsp Title: Find, Download and Process MODIS Land Products Data Type: Package -Version: 2.0.7 +Version: 2.0.9 Authors@R: c(person("Lorenzo", "Busetto", role = c("aut"), comment = c(ORCID = '0000-0001-9634-6038')), @@ -74,7 +74,7 @@ Suggests: rgdal, rmarkdown, shiny, - shinyalert, + shinyalert (>= 3.0.0), shinydashboard, shinyFiles (>= 0.9.0), shinyjs, @@ -85,12 +85,12 @@ Suggests: tidyr, qpdf, xtable -SystemRequirements: +SystemRequirements: GDAL (>= 2.1.2) with support for HDF4 format, PROJ (>= 4.9.1). URL: https://github.com/ropensci/MODIStsp/, https://docs.ropensci.org/MODIStsp/ BugReports: https://github.com/ropensci/MODIStsp/issues LazyData: true VignetteBuilder: knitr -RoxygenNote: 7.1.2 +RoxygenNote: 7.2.1 Roxygen: list(markdown = TRUE) Encoding: UTF-8 Language: en-US diff --git a/NAMESPACE b/NAMESPACE index 540ca1ce..02c08fcb 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -57,6 +57,7 @@ importFrom(sf,st_bbox) importFrom(sf,st_coordinates) importFrom(sf,st_crop) importFrom(sf,st_crs) +importFrom(sf,st_drivers) importFrom(sf,st_geometry) importFrom(sf,st_read) importFrom(sf,st_set_crs) diff --git a/NEWS.md b/NEWS.md index b3e99c1e..58f5bd72 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,3 +1,20 @@ +# MODIStsp 2.0.9 + +## Minor changes +- Revise the authenticate type to `"any"` (default is `"basic"`) to reflect + changes on USGS authentication after the maintenance of the U.S. GOVERNMENT COMPUTER. +## Bug fixes +- Remove `useshinyalert()` to avoid warnings. + + +# MODIStsp 2.0.8 + +## Minor changes +- Reducing package size +- State that GDAL with support for HDF4 format is needed (in vignette and + package description), and exit gracefully if HDF4 is not supported. + + # MODIStsp 2.0.7 ## Minor changes diff --git a/R/MODIStsp.R b/R/MODIStsp.R index 4f5185cc..9eef47d9 100644 --- a/R/MODIStsp.R +++ b/R/MODIStsp.R @@ -160,22 +160,28 @@ #' # Note that this example (as well as the following ones) is run in single #' # core to follow CRAN policies, by setting parallel = FALSE. #' # Users can exploit multicore functionalities skipping to set this argument. +#' +#' # The following check is performed in order not to provide errors +#' # running the examples if HDF4 is not supported. +#' is_hdf4_supported <- "HDF4" %in% sf::st_drivers("raster")$name #' #' MODIStsp_get_prodlayers("M*D13A2") -#' MODIStsp( -#' gui = FALSE, -#' out_folder = "$tempdir", -#' selprod = "Vegetation_Indexes_16Days_1Km (M*D13A2)", -#' bandsel = c("EVI", "NDVI"), -#' quality_bandsel = "QA_usef", -#' indexes_bandsel = "SR", -#' user = "mstp_test" , -#' password = "MSTP_test_01", -#' start_date = "2020.06.01", -#' end_date = "2020.06.15", -#' verbose = FALSE, -#' parallel = FALSE -#' ) +#' if (is_hdf4_supported) { +#' MODIStsp( +#' gui = FALSE, +#' out_folder = "$tempdir", +#' selprod = "Vegetation_Indexes_16Days_1Km (M*D13A2)", +#' bandsel = c("EVI", "NDVI"), +#' quality_bandsel = "QA_usef", +#' indexes_bandsel = "SR", +#' user = "mstp_test" , +#' password = "MSTP_test_01", +#' start_date = "2020.06.01", +#' end_date = "2020.06.15", +#' verbose = FALSE, +#' parallel = FALSE +#' ) +#' } #' #' #' #' # - Running the tool using the settings previously saved in a specific options file @@ -189,7 +195,9 @@ #' #' opts_file <- system.file("testdata/test_MOD13A2.json", package = "MODIStsp") #' -#' MODIStsp(gui = FALSE, opts_file = opts_file, verbose = TRUE, parallel = FALSE) +#' if (is_hdf4_supported) { +#' MODIStsp(gui = FALSE, opts_file = opts_file, verbose = TRUE, parallel = FALSE) +#' } #' #' #' # Running the tool using the settings previously saved in a specific option file @@ -198,14 +206,16 @@ #' #' opts_file <- system.file("testdata/test_MOD13A2.json", package = "MODIStsp") #' spatial_file <- system.file("testdata/lakeshapes/garda_lake.shp", package = "MODIStsp") -#' MODIStsp( -#' gui = FALSE, -#' opts_file = opts_file, -#' spatmeth = "file", -#' spafile = spatial_file, -#' verbose = TRUE, -#' parallel = FALSE -#' ) +#' if (is_hdf4_supported) { +#' MODIStsp( +#' gui = FALSE, +#' opts_file = opts_file, +#' spatmeth = "file", +#' spafile = spatial_file, +#' verbose = TRUE, +#' parallel = FALSE +#' ) +#' } #' #' #' # Running the tool using the settings previously saved in a @@ -222,15 +232,17 @@ #' extent_list #' opts_file <- system.file("testdata/test_MOD13A2.json", package = "MODIStsp") #' -#' for (single_shape in extent_list) { -#' MODIStsp( -#' gui = FALSE, -#' opts_file = opts_file, -#' spatmeth = "file", -#' spafile = single_shape, -#' verbose = TRUE, -#' parallel = FALSE -#' ) +#' if (is_hdf4_supported) { +#' for (single_shape in extent_list) { +#' MODIStsp( +#' gui = FALSE, +#' opts_file = opts_file, +#' spatmeth = "file", +#' spafile = single_shape, +#' verbose = TRUE, +#' parallel = FALSE +#' ) +#' } #' } #' #' # output files are placed in separate folders: diff --git a/R/MODIStsp_extract.R b/R/MODIStsp_extract.R index cb0f02b6..bfa3e35b 100644 --- a/R/MODIStsp_extract.R +++ b/R/MODIStsp_extract.R @@ -95,12 +95,12 @@ #' # __NOTE__ To avoid redownloading, here we copy some test data from MODIStsp #' # installation folder to tempdir and use it to create a test time series. #' -#' test_folder <- system.file("testdata/VI_16Days_500m_v6/NDVI", -#' package = "MODIStsp") -#' dir.create(file.path(tempdir(), "MODIStsp/VI_16Days_500m_v6/NDVI/"), +#' test_zip <- system.file("testdata/VI_16Days_500m_v6/NDVI.zip", +#' package = "MODIStsp") +#' dir.create(file.path(tempdir(), "MODIStsp/VI_16Days_500m_v6"), #' showWarnings = FALSE, recursive = TRUE) -#' file.copy(list.files(test_folder, full.names = TRUE), -#' file.path(tempdir(), "MODIStsp/VI_16Days_500m_v6/NDVI/")) +#' utils::unzip(test_zip, +#' exdir = file.path(tempdir(), "MODIStsp/VI_16Days_500m_v6")) #' #' opts_file <- system.file("testdata/test_extract.json", package = "MODIStsp") #' MODIStsp(opts_file = opts_file, gui = FALSE, verbose = FALSE) diff --git a/R/MODIStsp_process_bands.R b/R/MODIStsp_process_bands.R index be608fcc..22876cd3 100644 --- a/R/MODIStsp_process_bands.R +++ b/R/MODIStsp_process_bands.R @@ -40,7 +40,7 @@ #' @author Lorenzo Busetto, phD (2014-2017) #' @author Luigi Ranghetti, phD (2015) \email{luigi@@ranghetti.info} #' @importFrom parallel detectCores -#' @importFrom sf gdal_utils gdal_subdatasets sf_extSoftVersion +#' @importFrom sf gdal_utils gdal_subdatasets sf_extSoftVersion st_drivers #' @importFrom stats na.omit #' @importFrom gdalUtilities gdal_translate gdalwarp gdalbuildvrt #' @importFrom stringr str_sub @@ -132,6 +132,12 @@ MODIStsp_process_bands <- function(out_folder_mod, modislist, outfile_vrt <- tempfile(fileext = ".vrt", tmpdir = tmpdir) + # Exist if HDF4 is not supported + if (!"HDF4" %in% sf::st_drivers("raster")$name) { + stop("Your current GDAL environment does not support HDF4 file format. + Please recompile GDAL including HDF4 drivers.") + } + # workaround to avoid gdalbuildvrt bug in creation of vrt # files for UInt32 data type - # create tiff files from the original hdfs, and diff --git a/R/check_proc_opts.R b/R/check_proc_opts.R index 3b342a25..c3946537 100644 --- a/R/check_proc_opts.R +++ b/R/check_proc_opts.R @@ -4,6 +4,7 @@ #' @param proc_opts data frame of parameters passed by `MODIStsp` #' @return NULL - processing interrupted if any condition is not met #' @importFrom assertthat is.dir see_if is.string is.number +#' @keywords internal #' check_proc_opts <- function(proc_opts) { diff --git a/R/load_prodopts.R b/R/load_prodopts.R index 57149755..3fac396a 100644 --- a/R/load_prodopts.R +++ b/R/load_prodopts.R @@ -21,7 +21,7 @@ load_prodopts <- function() { # prodopts_file <- file.path(prodopts_dir, "MODIStsp_ProdOpts.RData") # # XML file describing MODIS products - xml_file <- system.file("ExtData", "MODIStsp_ProdOpts.xml", + xml_file <- system.file("ExtData", "MODIStsp_ProdOpts.xml.zip", package = "MODIStsp") if (file.exists(prodopts_file)) { diff --git a/README.Rmd b/README.Rmd index 23cc03df..1289d9a0 100644 --- a/README.Rmd +++ b/README.Rmd @@ -15,7 +15,6 @@ knitr::opts_chunk$set( ``` [![](https://www.r-pkg.org/badges/version-ago/MODIStsp)](https://cran.r-project.org/package=MODIStsp) [![](https://cranlogs.r-pkg.org/badges/MODIStsp?color=orange)](https://cran.r-project.org/package=MODIStsp) -[![Travis-CI Build Status](https://travis-ci.org/ropensci/MODIStsp.svg?branch=master)](https://travis-ci.org/ropensci/MODIStsp) [![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.1972039.svg)](https://doi.org/10.5281/zenodo.1972039) [![Coverage Status](https://img.shields.io/codecov/c/github/ropensci/MODIStsp/master.svg)](https://codecov.io/github/ropensci/MODIStsp?branch=master) [![](https://badges.ropensci.org/184_status.svg)](https://github.com/ropensci/software-review/issues/184) diff --git a/README.md b/README.md index 53494d0e..d7064989 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,6 @@ [![](https://www.r-pkg.org/badges/version-ago/MODIStsp)](https://cran.r-project.org/package=MODIStsp) [![](https://cranlogs.r-pkg.org/badges/MODIStsp?color=orange)](https://cran.r-project.org/package=MODIStsp) -[![Travis-CI Build -Status](https://travis-ci.org/ropensci/MODIStsp.svg?branch=master)](https://travis-ci.org/ropensci/MODIStsp) [![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.1972039.svg)](https://doi.org/10.5281/zenodo.1972039) [![Coverage Status](https://img.shields.io/codecov/c/github/ropensci/MODIStsp/master.svg)](https://codecov.io/github/ropensci/MODIStsp?branch=master) diff --git a/cran-comments.md b/cran-comments.md index 13600a74..99b471ab 100644 --- a/cran-comments.md +++ b/cran-comments.md @@ -1,3 +1,72 @@ +MODIStsp 2.0.9 +================ + +* Windows 11 on local install, R 4.2.1 +* ArchLinux on local install, R 4.2.1 +* win-builder (R-devel, R-release, R-oldrelease) + +## R CMD check results + +There were no ERRORs nor WARNINGs. + +`check_win_oldrelease()` returns the following NOTE: +``` +Possibly mis-spelled words in DESCRIPTION: + Busetto (40:5) + HDF (29:24) + MODIS (2:35, 25:10, 29:18, 30:60, 38:18) + Ranghetti (40:17) + mosaicking (26:43) + rasters (24:63) + reflectance (31:50, 32:65) + reprojecting (26:55) + resizing (26:72) +``` +All these words are correctly spelled, and they do not contain package names +nor book titles, so they should not be quoted. + + +MODIStsp 2.0.8 +================ + +* Windows 10 on local install, R 4.1.3 +* ArchLinux on local install, R 4.1.3 +* win-builder (R-devel, R-release, R-oldrelease) + +## R CMD check results + +There were no ERRORs, WARNINGs nor NOTEs. + +This submission fixes the following CRAN NOTEs: +``` +Version: 2.0.7 +Check: installed package size +Result: NOTE + installed size is 5.1Mb + sub-directories of 1Mb or more: + ExtData 1.9Mb + app 1.3Mb + testdata 1.0Mb +Flavors: r-devel-linux-x86_64-fedora-clang, r-devel-macos-arm64, r-devel-macos-x86_64, r-release-macos-arm64, r-release-macos-x86_64, r-oldrel-macos-x86_64 +``` +Package size was reduced using zip archives and resizing the logo. + +Moreover, the following error appeared as additional donttest issue: +``` +Error in gdal_utils("buildvrt", gdalfile, output.vrt, opts) : + gdal_utils buildvrt: an error occured +Calls: MODIStsp ... MODIStsp_process_bands -> -> gdal_utils +Execution halted +``` +This occurs when the local GDAL environment does not support HDF4 format, +which is required by the package. +This requirement was now explicitly assessed both in the package description +than in the vignette documentation. +If the user tries to run functions while HDF4 is not supported, the code +exits gracefully informing that "Your current GDAL environment does not support +HDF4 file format. Please recompile GDAL including HDF4 drivers.". + + MODIStsp 2.0.7 ================ diff --git a/docs/404.html b/docs/404.html index a70d905b..0c719ac3 100644 --- a/docs/404.html +++ b/docs/404.html @@ -5,13 +5,13 @@ -Page not found (404) • rOpenSci: MODIStsp +Page not found (404) • MODIStsp - - + + @@ -28,9 +28,9 @@