Skip to content

Commit 1ca9df6

Browse files
committed
test update
1 parent 8b64de4 commit 1ca9df6

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+301
-222
lines changed

DESCRIPTION

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ Authors@R:
3333
)
3434
Maintainer: Unai Pérez - Goya <[email protected]>
3535
Description: Downloading, customizing, and processing time series of satellite images for a region of interest. 'rsat' functions allow a unified access to multispectral images from Landsat, MODIS and Sentinel repositories. 'rsat' also offers capabilities for customizing satellite images, such as tile mosaicking, image cropping and new variables computation. Finally, 'rsat' covers the processing, including cloud masking, compositing and gap-filling/smoothing time series of images (Militino et al., 2018 <doi:10.3390/rs10030398> and Militino et al., 2019 <doi:10.1109/TGRS.2019.2904193>).
36-
Depends: R (>= 4.0.0)
36+
Depends: R (>= 4.3.2)
3737
Imports: XML, curl, httr, leafem, leaflet, rjson, rvest, tmap, xml2, zip, methods, Rdpack, fields, calendR, sf, stars, terra, sp, raster
3838
URL: https://github.com/ropensci/rsat
3939
BugReports: https://github.com/ropensci/rsat/issues

R/data.R

+18
Original file line numberDiff line numberDiff line change
@@ -67,5 +67,23 @@ NULL
6767
#' @keywords data
6868
NULL
6969

70+
#' Result of IMA test 1
71+
#'
72+
#' Filled image to test the package
73+
#'
74+
#' @name tiles.mod.ndvi.filled.1.res
75+
#' @docType data
76+
#' @keywords data
77+
NULL
78+
79+
#' Result of IMA test 2
80+
#'
81+
#' Filled image to test the package
82+
#'
83+
#' @name tiles.mod.ndvi.filled.2.res
84+
#' @docType data
85+
#' @keywords data
86+
NULL
87+
7088
#' @docType package
7189
#' @bibliography system.file("REFERENCES.bib", package = "rsat")

R/rsat_download.R

+34-21
Original file line numberDiff line numberDiff line change
@@ -91,27 +91,40 @@ setMethod(
9191
do.call(entry$func, entry$args)
9292
}, mc.cores = 3)
9393
}else{
94-
if(length(usgs)>0){
95-
espa.orders <- connection$getApi("usgs")$order_usgs_records(usgs,
96-
db_path,
97-
verbose,
98-
...)
99-
}
100-
if(length(lpdaac)>0){
101-
connection$getApi("lpdaac")$download_lpdaac_records(lpdaac,
102-
db_path,
103-
verbose,...)
104-
}
105-
if(length(dataspace)>0){
106-
connection$getApi("dataspace")$dataspace_download_records(dataspace,
107-
db_path,
108-
verbose,...)
109-
}
110-
if(length(usgs)>0){
111-
connection$getApi("usgs")$download_espa_orders(espa.orders,
112-
db_path,
113-
verbose,...)
114-
}
94+
functions_list <- list(
95+
list(func = connection$getApi("usgs")$order_usgs_records,
96+
args = list(lpdaac_records=usgs,db_path=db_path,verbose=verbose,...)),
97+
list(func = connection$getApi("lpdaac")$download_lpdaac_records,
98+
args = list(lpdaac_records=lpdaac,db_path=db_path,verbose=verbose,...)),
99+
list(func = connection$getApi("dataspace")$dataspace_download_records,
100+
args = list(records=dataspace,db_path=db_path,verbose=verbose,...)),
101+
list(func = connection$getApi("usgs")$download_espa_orders,
102+
args = list(usgs=usgs,db_path=db_path,verbose=verbose,...))
103+
)
104+
lapply(functions_list, function(entry) {
105+
do.call(entry$func, entry$args)
106+
})
107+
# if(length(usgs)>0){
108+
# espa.orders <- connection$getApi("usgs")$order_usgs_records(usgs,
109+
# db_path,
110+
# verbose,
111+
# ...)
112+
# }
113+
# if(length(lpdaac)>0){
114+
# connection$getApi("lpdaac")$download_lpdaac_records(lpdaac,
115+
# db_path,
116+
# verbose,...)
117+
# }
118+
# if(length(dataspace)>0){
119+
# connection$getApi("dataspace")$dataspace_download_records(dataspace,
120+
# db_path,
121+
# verbose,...)
122+
# }
123+
# if(length(usgs)>0){
124+
# connection$getApi("usgs")$download_espa_orders(espa.orders,
125+
# db_path,
126+
# verbose,...)
127+
# }
115128
}
116129
}
117130
)

R/rtoi.R

+2
Original file line numberDiff line numberDiff line change
@@ -464,6 +464,8 @@ setMethod(
464464
"get_database",
465465
signature = c(x = "missing"),
466466
function() {
467+
if(getRSATOpt("RSAT_DATABASE")=="")
468+
warning("Database not defined, use the set_database function to define it.")
467469
return(getRSATOpt("RSAT_DATABASE"))
468470
}
469471
)
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

0 commit comments

Comments
 (0)