Closed jschon637 closed 3 years ago
I'm not sure if this helps with my question, but the following code produces a similar error message:
raster::plot(inrts) Error in .local(.Object, ...) : Warning message: In graphics::par(old.par) : calling par(new=TRUE) with no plot
I also checked whether I could look at a subset of the RasterStack, and this is possible:
inrts[[1]] class : RasterLayer dimensions : 8221, 8664, 71226744 (nrow, ncol, ncell) resolution : 0.01025581, 0.01025546 (x, y) extent : -25.36055, 63.49575, -46.96973, 37.34041 (xmin, xmax, ymin, ymax) crs : +proj=longlat +datum=WGS84 +no_defs source : /home/jss5yf/Africa_2016/VI_Monthly_1Km_v6/NDVI/MOD13A3_NDVI_2003_001.tif names : MOD13A3_NDVI_2003_001 time : 2003-01-01
The source file name here comes from doing his download on my university's HPC.
Apologies, I stumbled on the solution. I had used MODIStsp to download the data on my university's HPC, and then downloaded the files onto my computer. Apparently, this messes up the RasterStack objects because they store summary information about the rasters, but not the raster data itself. So when I stack individual rasters myself on my computer, and then extract from that with MODIStsp_extract, everything works great. It looks like my problem came from misunderstanding RasterStack objects. I will close the issue now.
Issue description
I am unable to extract a time series from my Raster Stack, using MODIStsp_extract. I am struggling to figure out what I am doing wrong. I am sharing details about the objects I am using and my code. Any help to fix this will be greatly appreciated.
Also, my error is similar I believe to what appeared here: https://github.com/ropensci/MODIStsp/issues/173
Reproducible example
I get the following output. I am specifically concerned about the line "Error in .local(.Object, ...) : "
although coordinates are longitude/latitude, st_intersection assumes that they are planar Error in .local(.Object, ...) : In addition: Warning message: attribute variables are assumed to be spatially constant throughout all geometries
Matrix products: default
locale: [1] LC_COLLATE=English_United States.1252 LC_CTYPE=English_United States.1252
[3] LC_MONETARY=English_United States.1252 LC_NUMERIC=C
[5] LC_TIME=English_United States.1252
attached base packages: [1] stats graphics grDevices utils datasets methods base
other attached packages: [1] cshapes_0.6 plyr_1.8.6 maptools_1.0-1 sf_0.9-3
[5] xts_0.12-0 zoo_1.8-8 raster_3.4-5 sp_1.4-1
[9] MODIStsp_2.0.5.9002
loaded via a namespace (and not attached): [1] Rcpp_1.0.5 xml2_1.3.2 magrittr_2.0.1 units_0.6-6
[5] lattice_0.20-41 R6_2.4.1 stringr_1.4.0 httr_1.4.2
[9] tools_4.0.2 rgdal_1.4-8 parallel_4.0.2 grid_4.0.2
[13] data.table_1.12.8 KernSmooth_2.23-17 e1071_1.7-3 DBI_1.1.0
[17] rgeos_0.5-3 remotes_2.3.0 class_7.3-17 yaml_2.2.1
[21] assertthat_0.2.1 gdalUtilities_1.1.2 bitops_1.0-6 codetools_0.2-16
[25] stringi_1.4.6 compiler_4.0.2 classInt_0.4-3 jsonlite_1.7.2
[29] foreign_0.8-80