r-spatial / rgee

Google Earth Engine for R
https://r-spatial.github.io/rgee/
Other
677 stars 146 forks source link

ee_image_to_drive doesn't rename #257

Closed graflukas138 closed 2 years ago

graflukas138 commented 2 years ago

At submit an issue, please attached the following information of your rgee session:

Attach your Python (reticulate) configuration:

python: C:/Hyapp/Anaconda3-2020.11/envs/rgee/python.exe libpython: C:/Hyapp/Anaconda3-2020.11/envs/rgee/python38.dll pythonhome: C:/Hyapp/Anaconda3-2020.11/envs/rgee version: 3.8.13 | packaged by conda-forge | (default, Mar 25 2022, 05:59:45) [MSC v.1929 64 bit (AMD64)] Architecture: 64bit numpy: C:/Hyapp/Anaconda3-2020.11/envs/rgee/Lib/site-packages/numpy numpy_version: 1.22.3 ee: C:\Hyapp\ANACON~1.11\envs\rgee\lib\site-packages\ee__init__.p

Description

Hi,

I was trying to copy some image to my local drive. Since I'm working with several years of data I wrote a for-loop to filter data and rename the file in drive automatically. The code runs fine, however the files in my drive end up with unusable names, even if I try to configure every possible character string.

Actual name: drive_7_2022_05_02_21_32_43.tif Expected name: year2008.tif

What I Did


for(i in 2008:2018) {
  a = landsatyearly$
    filter(ee$Filter$calendarRange(i, i, field = "year"))$
    first()
   name = paste("year", i, sep="")

  task =  ee$batch$Export$image$toDrive(
    description = name,
    image = a,
    region = area_geo
    )

  task$start()

  ee_monitoring(task)
}