r-spatial / rgee

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

Question: Continue after the task is disconnected #250

Closed TianyaImpression closed 2 years ago

TianyaImpression commented 2 years ago

image

Sometimes due to poor network, rgee's ee_as_raster task will be interrupted. Is there a way to make it continue to execute after it is interrupted? instead of running again?

Thank you for your reply!

csaybar commented 2 years ago

Hi @TianyaImpression, yes I highly recommend always using lazy=TRUE in case of poor internet connection. When 'lazy=TRUE', instead of getting a RasterStack object, it will retrieve a 'future::sequential' object.

For instance:

img_03 <- ee_as_raster(
 image = img,
 region = geometry,
 container = "rgee_dev",
 lazy = TRUE,
 via = "gcs"
)

The function above will create a future::sequential object with the EE task initialized (i.e. from GEE to DRIVE/GCS). Now using:

img_02_result <- img_02 %>% ee_utils_future_value()

Users can decide when exporting the results (from DRIVE/GCS to local). I see that your task was running for a long time, idk the context, but maybe would be better to create small chunks to avoid very long waits.

TianyaImpression commented 2 years ago

@csaybar Thank you for your reply! I use GEE to obtain a large range of Landsat images, so the stitching is very time-consuming, and the general processing process will not be interrupted, but the process of rgee Moving image from Google Drive to Local is sometimes interrupted due to the influence of the network. I would like to know this rgee from the Internet Can the process of downloading data from disk be resumed? I am currently downloading manually from the Google Drive