zz_lazyload.R 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. # lazy loading
  2. ##########################################
  3. suppressWarnings(
  4. avl <- "MODIS" %in% installed.packages()
  5. )
  6. ofl = ifelse(!avl
  7. , file.path(getwd(), "inst/external")
  8. , system.file("external", package = "MODIS"))
  9. ofl = gsub("/R/inst/external", "/inst/external", ofl)
  10. tiletable <- read.table(file.path(ofl, "tiletable.txt"), header = TRUE)
  11. # save(tileNames,file="~/tileNames.RData") # in case of changes
  12. load(file.path(ofl, "tileNames.RData"))
  13. # load MODIS Tiles (sr)
  14. load(file.path(ofl, "MODIS_TilesPolys.RData"))
  15. # save(MODIS_Products,file="~/MODIS_Products.RData") # in case of changes
  16. load(file.path(ofl, "MODIS_Products.RData"))
  17. load(file.path(ofl, "collections.RData"))
  18. ## pitty that this does not work like that!
  19. ## lazy load gdal EPSG
  20. #if (require(rgdal))
  21. #{
  22. # EPSGinfo <- make_EPSG() # if rgdal, make it new!
  23. #} else
  24. #{
  25. # save(EPSGinfo,file="~/EPSGinfo.RData") # periodically safed manually by Admin (last up: October2014)
  26. load(file.path(ofl, "EPSGinfo.RData"))
  27. #}
  28. ###
  29. # FTP information
  30. # save(MODIS_FTPinfo,file="~/MODIS_FTPinfo.RData") # in case of changes
  31. load(file.path(ofl, "MODIS_FTPinfo.RData"))
  32. # mrtOutDriver <- c("raw binary","HDF-EOS","GeoTiff","HDF4Image","GTiff")