appelmar / gdalcubes_cpp

Earth observation data cubes from GDAL image collections
MIT License
74 stars 7 forks source link

stac_image_collection crashing RStudio #48

Closed Lvulis closed 1 year ago

Lvulis commented 2 years ago

I've been going through the Geocomputation with R textbook and have run into an issue with gdalcubes crashing in the example script given here..

library(rstac)
library(gdalcubes)

s = stac("https://earth-search.aws.element84.com/v0")
items = s |>
  stac_search(collections = "sentinel-s2-l2a-cogs",
              bbox = c(7.1, 51.8, 7.2, 52.8), 
              datetime = "2020-01-01/2020-12-31") |>
  post_request() |> items_fetch()

collection = stac_image_collection(items$features, 
                                   property_filter = function(x) {x[["eo:cloud_cover"]] < 10})

RStudio crashes upon running stac_image_collection(). The RGui terminal also freezes. Not sure if this is overwhelming the RAM on my machine (32 GB) or what.

Info (I actually have windows 11, not sure why it says Windows 10).

> sessionInfo()
R version 4.2.0 (2022-04-22 ucrt)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 22000)

Matrix products: default

locale:
[1] LC_COLLATE=English_United States.utf8 
[2] LC_CTYPE=English_United States.utf8   
[3] LC_MONETARY=English_United States.utf8
[4] LC_NUMERIC=C                          
[5] LC_TIME=English_United States.utf8    

attached base packages:
[1] stats     graphics  grDevices utils     datasets 
[6] methods   base     

loaded via a namespace (and not attached):
 [1] pkgload_1.2.4      viridisLite_0.4.0 
 [3] brio_1.1.3         sp_1.5-0          
 [5] stats4_4.2.0       link2GI_0.4-7     
 [7] remotes_2.4.2      sessioninfo_1.2.2 
 [9] pillar_1.8.0       lattice_0.20-45   
[11] glue_1.6.2         digest_0.6.29     
[13] RColorBrewer_1.1-3 colorspace_2.0-3  
[15] htmltools_0.5.2    XML_3.99-0.10     
[17] pkgconfig_2.0.3    devtools_2.4.3    
[19] raster_3.5-21      stars_0.5-5       
[21] purrr_0.3.4        webshot_0.5.3     
[23] scales_1.2.0       processx_3.7.0    
[25] terra_1.5-34       satellite_1.0.4   
[27] tibble_3.1.7       proxy_0.4-27      
[29] generics_0.1.2     usethis_2.1.6     
[31] ellipsis_0.3.2     cachem_1.0.6      
[33] withr_2.5.0        cli_3.3.0         
[35] mapview_2.11.0     magrittr_2.0.3    
[37] crayon_1.5.1       memoise_2.0.1     
[39] ps_1.7.1           fs_1.5.2          
[41] fansi_1.0.3        xml2_1.3.3        
[43] lwgeom_0.2-8       class_7.3-20      
[45] pkgbuild_1.3.1     tools_4.2.0       
[47] prettyunits_1.1.1  lifecycle_1.0.1   
[49] stringr_1.4.0      munsell_0.5.0     
[51] callr_3.7.0        compiler_4.2.0    
[53] e1071_1.7-11       rlang_1.0.4       
[55] classInt_0.4-7     units_0.8-0       
[57] grid_4.2.0         tmaptools_3.1-1   
[59] dichromat_2.0-0.1  rstudioapi_0.13   
[61] htmlwidgets_1.5.4  crosstalk_1.2.0   
[63] leafem_0.2.0       base64enc_0.1-3   
[65] testthat_3.1.4     codetools_0.2-18  
[67] abind_1.4-5        DBI_1.1.3         
[69] roxygen2_7.2.0     R6_2.5.1          
[71] knitr_1.39         dplyr_1.0.9       
[73] fastmap_1.1.0      utf8_1.2.2        
[75] rprojroot_2.0.3    KernSmooth_2.23-20
[77] desc_1.4.1         stringi_1.7.8     
[79] parallel_4.2.0     Rcpp_1.0.8.3      
[81] vctrs_0.4.1        sf_1.0-7          
[83] png_0.1-7          leaflet_2.1.1     
[85] tidyselect_1.1.2   xfun_0.31  
appelmar commented 1 year ago

Sorry for my late reply, this issue has been fixed with version 0.6.4 (see https://github.com/appelmar/gdalcubes/commit/d799262f8063f059fab5607589d714bd261be7aa).