Skip to content

Commit

Permalink
RC v. 2.0.10 (#264)
Browse files Browse the repository at this point in the history
## Minor changes
- Remove explicit {rgdal} dependency (`https://r-spatial.org/r/2022/12/14/evolution2.html`).
- Remove suggested dependency {geojsonlint}.
- Change maintainer's email in order to follow CRAN requirements.
  • Loading branch information
ranghetti authored Jun 12, 2023
1 parent 24258f0 commit 082b1a3
Show file tree
Hide file tree
Showing 157 changed files with 11,049 additions and 9,307 deletions.
8 changes: 4 additions & 4 deletions .github/ISSUE_TEMPLATE/missing---unclear-documentation.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,17 @@ The following template instructions are kept for backwards compatibility.
---

<!--
Use this template if you need information about {sen2r} funcionalities which are not [well] documented. You can use it also for GENERAL questions (e.g. "Is it possible to [...] with sen2r?"); instead, for questions related to use cases (or if in doubt about which template to use) please use the "Help needed" template.
Use this template if you need information about {MODIStsp} funcionalities which are not [well] documented. You can use it also for GENERAL questions (e.g. "Is it possible to [...] with sen2r?"); instead, for questions related to use cases (or if in doubt about which template to use) please use the "Help needed" template.
Before opening a new issue:
1. please read the online documentation at https://sen2r.ranghetti.info/ (https://sen2r.ranghetti.info/reference/ in case of a question about a specific function);
2. if your question is related to the {sen2r} GUI, read the embedded documentation ("?" marks in the GUI);
1. please read the online documentation at https://https://docs.ropensci.org/MODIStsp/ (https://docs.ropensci.org/MODIStsp/reference/ in case of a question about a specific function);
2. if your question is related to the {MODIStsp} GUI, read the embedded documentation ("?" marks in the GUI);
3. check if the question was already been mentioned as a GitHub issue.
If your question is not general but related with your specific use case, please use the "Help needed" template.
IMPORTANT NOTES
1. Please remember that {sen2r} is not a commercial tool, so the developer is not obliged to provide assistance: please be polite, be patient if noone will answer you instantly and respect the Code of Conduct (https://sen2r.ranghetti.info/CODE-OF-CONDUCT.html)
1. Please remember that {MODIStsp} is not a commercial tool, so the developer is not obliged to provide assistance: please be polite, be patient if noone will answer you instantly and respect the Code of Conduct (https://ropensci.org/code-of-conduct/)
2. Your are required to answer when details (generally outputs of R commands) are required, and to provide a feedback after opening an issue, even after solving your problem or if you are not yet interested in solving it. In the case of missing feedback, the developer reserve the right to ignore your future requests.
3. Tasks can be closed after 10 days of inactivity (you can reopen it if you need further help).
-->
Expand Down
7 changes: 3 additions & 4 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ Package: MODIStsp
Title: Find, Download and Process MODIS Land Products
Data
Type: Package
Version: 2.0.9
Version: 2.0.10
Authors@R: c(person("Lorenzo", "Busetto",
role = c("aut"),
comment = c(ORCID = '0000-0001-9634-6038')),
person("Luigi", "Ranghetti",
email = "luigi@ranghetti.info",
email = "rpackages.ranghetti@gmail.com",
role = c("aut", "cre"),
comment = c(ORCID = '0000-0001-6207-5188')),
person("Leah", "Wasser",
Expand Down Expand Up @@ -70,7 +70,6 @@ Suggests:
mapedit (>= 0.6.0),
png,
rappdirs,
rgdal,
rmarkdown,
shiny,
shinyalert (>= 3.0.0),
Expand All @@ -90,7 +89,7 @@ URL: https://github.com/ropensci/MODIStsp/, https://docs.ropensci.org/MODIStsp/
BugReports: https://github.com/ropensci/MODIStsp/issues
LazyData: true
VignetteBuilder: knitr
RoxygenNote: 7.2.1
RoxygenNote: 7.2.3
Roxygen: list(markdown = TRUE)
Encoding: UTF-8
Language: en-US
8 changes: 8 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
# MODIStsp 2.0.10

## Minor changes
- Remove explicit {rgdal} dependency (`https://r-spatial.org/r/2022/12/14/evolution2.html`).
- Remove suggested dependency {geojsonlint}.
- Change maintainer's email in order to follow CRAN requirements.


# MODIStsp 2.0.9

## Minor changes
Expand Down
2 changes: 1 addition & 1 deletion R/MODIStsp-package.R
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
#' @docType package
#' @name MODIStsp-package
#' @author Lorenzo Busetto, phD (2014-2017)
#' @author Luigi Ranghetti, phD (2015-2017) \email{luigi@@ranghetti.info}
#' @author Luigi Ranghetti, phD (2015-2017)
#' @seealso [https://docs.ropensci.org/MODIStsp/](https://docs.ropensci.org/MODIStsp/)
#' @seealso [https://github.com/ropensci/MODIStsp](https://github.com/ropensci/MODIStsp)
#'
Expand Down
38 changes: 19 additions & 19 deletions R/MODIStsp.R
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
#' Default: NULL
#' @param prod_version Version of the selected MODIS product.
#' Currently versions `"006"` and/or `"061"` can be chosen.
#' Default value is `"006"` until decommission of this version will be
#' Default value is `"006"` until decommission of this version will be
#' announced by USGS.
#' Products with version `"061` are experimental: in case users would encounter
#' an error in the encoding of bands or quality flags they are encouraged
Expand Down Expand Up @@ -121,14 +121,14 @@
#' @param parallel `logical` If TRUE (default), the function is run using parallel
#' processing, to speed-up the computation for large rasters (with a maximum
#' of 8 cores).
#' The number of cores is automatically determined; specifying it is also
#' The number of cores is automatically determined; specifying it is also
#' possible (e.g. `parallel = 4`). In this case, more than 8 cores can be
#' specified. If FALSE (default), single core processing is used.
#' @param ... not used for values, forces later arguments to bind by name
#' @return NULL
#'
#' @author Lorenzo Busetto, phD (2014-2017)
#' @author Luigi Ranghetti, phD (2015-2017) \email{luigi@@ranghetti.info}
#' @author Luigi Ranghetti, phD (2015-2017)
#' @note License: GPL 3.0
#' @export
#' @seealso [MODIStsp_GUI()], [MODIStsp_process()]
Expand Down Expand Up @@ -160,7 +160,7 @@
#' # 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
Expand Down Expand Up @@ -194,7 +194,7 @@
#' # and retrieves NDVI and EVI data, plus the Usefulness Index Quality Indicator.
#'
#' opts_file <- system.file("testdata/test_MOD13A2.json", package = "MODIStsp")
#'
#'
#' if (is_hdf4_supported) {
#' MODIStsp(gui = FALSE, opts_file = opts_file, verbose = TRUE, parallel = FALSE)
#' }
Expand All @@ -208,10 +208,10 @@
#' spatial_file <- system.file("testdata/lakeshapes/garda_lake.shp", package = "MODIStsp")
#' if (is_hdf4_supported) {
#' MODIStsp(
#' gui = FALSE,
#' gui = FALSE,
#' opts_file = opts_file,
#' spatmeth = "file",
#' spafile = spatial_file,
#' spafile = spatial_file,
#' verbose = TRUE,
#' parallel = FALSE
#' )
Expand All @@ -223,22 +223,22 @@
#' # spatial file (e.g., to perform the same processing on several extents)
#' # Note that you can also put all your extent files in a specific folder and
#' # create the extent list using for example.
#'
#'
#' extent_list = list.files(
#' system.file("testdata/lakeshapes/", package = "MODIStsp"),
#' "\\.shp$",
#' "\\.shp$",
#' full.names = TRUE
#' )
#' extent_list
#' opts_file <- system.file("testdata/test_MOD13A2.json", package = "MODIStsp")
#'
#'
#' if (is_hdf4_supported) {
#' for (single_shape in extent_list) {
#' MODIStsp(
#' gui = FALSE,
#' gui = FALSE,
#' opts_file = opts_file,
#' spatmeth = "file",
#' spafile = single_shape,
#' spafile = single_shape,
#' verbose = TRUE,
#' parallel = FALSE
#' )
Expand Down Expand Up @@ -456,10 +456,10 @@ MODIStsp <- function(...,
# update proc_opts based on arguments passed to the function ----

if(!is.null(selprod)) {proc_opts$selprod <- selprod}

if(!is.null(prod_version)) {proc_opts$prod_version <- prod_version}
if(proc_opts$prod_version=="6") {proc_opts$prod_version <- "006"} # for retrocompatibility

if(!is.null(bandsel)) {proc_opts$bandsel <- bandsel}

if(!is.null(quality_bandsel)) {proc_opts$quality_bandsel <- quality_bandsel}
Expand All @@ -484,20 +484,20 @@ MODIStsp <- function(...,

if(!is.null(out_projsel)) {proc_opts$out_projsel <- out_projsel}
if(!is.null(output_proj)) {proc_opts$output_proj <- output_proj}

if(!is.null(out_res_sel)) {proc_opts$out_res_sel <- out_res_sel}
if(!is.null(out_res)) {proc_opts$out_res <- out_res}
if(!is.null(resampling)) {proc_opts$resampling <- resampling}

if(!is.null(reprocess)) {proc_opts$reprocess <- reprocess}
if(!is.null(delete_hdf)) {proc_opts$delete_hdf <- delete_hdf}
if(!is.null(nodata_change)) {proc_opts$nodata_change <- nodata_change}
if(!is.null(scale_val)) {proc_opts$scale_val <- scale_val}

if(!is.null(out_format)) {proc_opts$out_format <- out_format}
if(!is.null(ts_format)) {proc_opts$ts_format <- ts_format}
if(!is.null(compress)) {proc_opts$compress <- compress}

if(!is.null(out_folder)) {proc_opts$out_folder <- out_folder}
if(!is.null(out_folder_mod)) {proc_opts$out_folder_mod <- out_folder_mod}

Expand Down Expand Up @@ -567,7 +567,7 @@ MODIStsp <- function(...,
tools::file_path_sans_ext(basename(spafile))
)
}

if (inherits(proc_opts$bbox, "list")) {
proc_opts$bbox <- unlist(proc_opts$bbox)
}
Expand Down
2 changes: 1 addition & 1 deletion R/MODIStsp_GUI.R
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#' the GUI and allowing to set, save, load options and eventually
#' launch the processing.
#' @author Lorenzo Busetto, phD (2014-2017)
#' @author Luigi Ranghetti, phD (2015) \email{luigi@@ranghetti.info}
#' @author Luigi Ranghetti, phD (2015)
#' @note License: GPL 3.0
#' @importFrom utils packageVersion browseURL
#'
Expand Down
2 changes: 1 addition & 1 deletion R/MODIStsp_addindex.R
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
#' MODIStsp_indexes.json
#' is modified so to allow computation of the additional indexes.
#' @author Lorenzo Busetto, phD (2014-2017)
#' @author Luigi Ranghetti, phD (2015) \email{luigi@@ranghetti.info}
#' @author Luigi Ranghetti, phD (2015)
#' @note License: GPL 3.0
#' @seealso [MODIStsp_resetindexes]
#' @export
Expand Down
2 changes: 1 addition & 1 deletion R/MODIStsp_download.R
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
#' @return The function is called for its side effects
#' @rdname MODIStsp_download
#' @author Lorenzo Busetto, phD (2014-2017)
#' @author Luigi Ranghetti, phD (2015) \email{luigi@@ranghetti.info}
#' @author Luigi Ranghetti, phD (2015)
#' @importFrom httr RETRY authenticate content GET write_disk
#' @importFrom xml2 as_list

Expand Down
2 changes: 1 addition & 1 deletion R/MODIStsp_install_launcher.R
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
#' requires to set this option to TRUE (or to launch the script in a root session of R),
#' Default: FALSE
#' @return The function is called for its side effects.
#' @author Luigi Ranghetti, phD (2015) \email{luigi@@ranghetti.info}
#' @author Luigi Ranghetti, phD (2015)
#' @note License: GPL 3.0
#' @export
#' @rdname install_MODIStsp_launcher
Expand Down
8 changes: 4 additions & 4 deletions R/MODIStsp_process.R
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,14 @@
#' @param parallel `logical` If TRUE (default), the function is run using parallel
#' processing, to speed-up the computation for large rasters (with a maximum
#' of 8 cores).
#' The number of cores is automatically determined; specifying it is also
#' The number of cores is automatically determined; specifying it is also
#' possible (e.g. `parallel = 4`). In this case, more than 8 cores can be
#' specified. If FALSE (default), single core processing is used.
#' @return The function is called for its side effects.
#' @author Lorenzo Busetto, phD (2014-2017)
#' @author Luigi Ranghetti, phD (2015) \email{luigi@@ranghetti.info}
#' @author Luigi Ranghetti, phD (2015)
#' @note Thanks Tomislav Hengl and Babak Naimi, whose scripts made the starting point for
#' development of this function ([ModisDownload](http://r-gis.net/?q=ModisDownload);
#' development of this function ([ModisDownload](https://r-gis.net/?q=ModisDownload);
#' [Download_and_resampling_of_MODIS_images](https://en.wikipedia.org/wiki/Regression-kriging?title=Download_and_resampling_of_MODIS_images))
#' @note License: GPL 3.0
#' @export
Expand Down Expand Up @@ -283,7 +283,7 @@ MODIStsp_process <- function(proc_opts,
download_server <- attr(date_dirs_all, "server")

if (download_server == "unreachable") {return(invisible(NULL))}

dates <- get_yeardates(proc_opts$download_range,
yy,
start_year, end_year,
Expand Down
2 changes: 1 addition & 1 deletion R/MODIStsp_process_QA_bits.R
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
#' @param compress `character` compression option for GTiff files
#' @return NULL
#' @author Lorenzo Busetto, phD (2017)
#' @author Luigi Ranghetti, phD (2017) \email{luigi@@ranghetti.info}
#' @author Luigi Ranghetti, phD (2017)
#' @note License: GPL 3.0
#' Based on the `modis.qc.R` script by Yann Chemin (2008) (\url{https://goo.gl/7Fhreo})
#' license GPL 3.0
Expand Down
2 changes: 1 addition & 1 deletion R/MODIStsp_process_bands.R
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
#' @return The function is called for its side effects
#' @rdname MODIStsp_process_bands
#' @author Lorenzo Busetto, phD (2014-2017)
#' @author Luigi Ranghetti, phD (2015) \email{luigi@@ranghetti.info}
#' @author Luigi Ranghetti, phD (2015)
#' @importFrom parallel detectCores
#' @importFrom sf gdal_utils gdal_subdatasets sf_extSoftVersion st_drivers
#' @importFrom stats na.omit
Expand Down
2 changes: 1 addition & 1 deletion R/MODIStsp_process_indexes.R
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
#' @return NULL - new raster file saved in out_filename
#'
#' @author Lorenzo Busetto, phD (2017)
#' @author Luigi Ranghetti, phD (2017) \email{luigi@@ranghetti.info}
#' @author Luigi Ranghetti, phD (2017)
#' @note License: GPL 3.0
#' @importFrom raster NAvalue overlay
#' @importFrom tools file_path_sans_ext
Expand Down
2 changes: 1 addition & 1 deletion R/MODIStsp_read_xml.R
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#' @return NULL - retrieved data are stored in the specified RData file
#'
#' @author Lorenzo Busetto, phD (2014-2017)
#' @author Luigi Ranghetti, phD (2015) \email{luigi@@ranghetti.info}
#' @author Luigi Ranghetti, phD (2015)
#' @note License: GPL 3.0
#' @importFrom xml2 as_list read_xml
#'
Expand Down
2 changes: 1 addition & 1 deletion R/MODIStsp_vrt_create.R
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
#' @return NULL - the function is called for its side effects
#'
#' @author Lorenzo Busetto, phD (2014-2017)
#' @author Luigi Ranghetti, phD (2015) \email{luigi@@ranghetti.info}
#' @author Luigi Ranghetti, phD (2015)
#' @note License: GPL 3.0
#' @importFrom stringr str_sub str_detect
#' @importFrom raster raster stack nlayers setZ
Expand Down
2 changes: 1 addition & 1 deletion R/bbox_from_file.R
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#' or string coercible to it using `sf::st_crs()` (e.g., WKT or numeric
#' EPSG code)
#' @author Lorenzo Busetto, phD (2017)
#' @author Luigi Ranghetti, phD (2017) \email{luigi@@ranghetti.info}
#' @author Luigi Ranghetti, phD (2017)
#' @importFrom sf st_crs st_read st_bbox
#' @importFrom raster raster
#' @note License: GPL 3.0
Expand Down
2 changes: 1 addition & 1 deletion R/check_files_existance.R
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
#' @param out_format `character` GTiff or ENVI
#' @return check - logical = 1 if all expected output files are already existing
#' @author Lorenzo Busetto, phD (2014-2017)
#' @author Luigi Ranghetti, phD (2015) \email{luigi@@ranghetti.info}
#' @author Luigi Ranghetti, phD (2015)
#' @note License: GPL 3.0

check_files_existence <- function(out_prod_folder,
Expand Down
2 changes: 1 addition & 1 deletion R/check_projection.R
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
#' @name check_projection
#' @rdname check_projection
#' @author Lorenzo Busetto, phD (2017)
#' @author Luigi Ranghetti, phD (2017) \email{luigi@@ranghetti.info}
#' @author Luigi Ranghetti, phD (2017)
#'
#' @examples
#'
Expand Down
2 changes: 1 addition & 1 deletion R/get_mod_dates.R
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#' @param date_dirs data frame full list of folders in lpdaac archive for product of interest
#' @return array of folder names containing data for the MODIS product acquired in
#' the period specified by "dates"
#' @author Luigi Ranghetti, phD (2016) \email{luigi@@ranghetti.info}
#' @author Luigi Ranghetti, phD (2016)
#' @author Lorenzo Busetto, phD (2017)
#' @note License: GPL 3.0
#'
Expand Down
4 changes: 2 additions & 2 deletions R/get_mod_dirs.R
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@
#' the requested MODIS product on lpdaac http archive, for the years
#' included in the time range selected for processing.
#' @author Original code by Babak Naimi (\code{.getModisList}, in
#' \href{http://r-gis.net/?q=ModisDownload}{ModisDownload.R})
#' \href{https://r-gis.net/?q=ModisDownload}{ModisDownload.R})
#' modified to adapt it to MODIStsp scheme and to http archive (instead than old
#' FTP) by:
#' @author Lorenzo Busetto, phD (2014-2017)
#' @author Luigi Ranghetti, phD (2016-2017) \email{luigi@@ranghetti.info}
#' @author Luigi Ranghetti, phD (2016-2017)
#' @note License: GPL 3.0
#' @importFrom stringr str_sub str_split
#' @importFrom httr RETRY authenticate content
Expand Down
4 changes: 2 additions & 2 deletions R/get_mod_filenames.R
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@
#' @return `character array` containing names of HDF images corresponding to the
#' requested tiles available for the product in the selected date
#' @author Original code by Babak Naimi (\code{.getModisList}, in
#' \href{http://r-gis.net/?q=ModisDownload}{ModisDownload.R})
#' \href{https://r-gis.net/?q=ModisDownload}{ModisDownload.R})
#' modified to adapt it to MODIStsp scheme and to http archive (instead than old
#' FTP) by:
#' @author Lorenzo Busetto, phD (2014-2016)
#' @author Luigi Ranghetti, phD (2016) \email{luigi@@ranghetti.info}
#' @author Luigi Ranghetti, phD (2016)
#' @note License: GPL 3.0
#' @importFrom httr RETRY authenticate content
#' @importFrom stringr str_split str_pad
Expand Down
4 changes: 2 additions & 2 deletions R/reproj_bbox.R
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
#' @param enlarge `logical`` if TRUE, the reprojected bounding box is the
#' one which completely include the original one; if FALSE, it is simply the
#' one obtained by reprojecting the upper-left and the lower-right corners.
#' @author Luigi Ranghetti, phD (2015) \email{luigi@@ranghetti.info}
#' @author Luigi Ranghetti, phD (2015)
#' @note License: GPL 3.0
#' @importFrom sf st_crs st_as_sf st_set_crs st_write st_as_text st_bbox st_read
#' @importFrom gdalUtilities ogr2ogr
Expand All @@ -23,7 +23,7 @@ reproj_bbox <- function(bbox, in_proj, out_proj, enlarge=TRUE) {

# fix bbox if it is a list (#228)
if (inherits(bbox, "list")) {bbox <- unlist(bbox)}

if (!inherits(in_proj, "crs")) {
if (suppressWarnings(!is.na(as.numeric(in_proj)))) {
in_proj <- as.numeric(in_proj)
Expand Down
Loading

0 comments on commit 082b1a3

Please sign in to comment.