Closed obaines closed 2 years ago
Hi @obaines
This problem was described in https://r-spatial.github.io/rgee/articles/considerations.html#be-careful-with-eedate
library(rgee)
ee_Initialize()
terraClim <- ee$ImageCollection("IDAHO_EPSCOR/TERRACLIMATE")$filterDate('1979-01-01', '2020-12-31')
#Printing the system:time_start property which returns -1
print(
terraClim$first()$get('system:time_start') %>% eedate_to_rdate()
)
#We can then convert this to a date (which also returns -1 when printing)
print(
ee$Date(terraClim$first()$get('system:time_start')) %>% eedate_to_rdate(timestamp = TRUE)
)
#But when we format this as a string, it returns the right date rather than -1
print(
ee$Date(terraClim$first()$get('system:time_start'))$format('YYYY-MM-dd') %>%
eedate_to_rdate()
)
Ah great - thought it was odd I didn't see an issue regarding this already! Thanks for your help @csaybar
At submit an issue, please attached the following information of your
rgee
session:[x] You have the Python API installed (from terminal):
[x] You can find the credentials file on your system:
[x] You can run a simple EE command from R:
Attach your Python (reticulate) configuration:
Description
I'm trying to use the terraClimate dataset (ee.ImageCollection("IDAHO_EPSCOR/TERRACLIMATE")) to produce yearly means for different climate variables. After some transformations (e.g. adding images together), Earth Engine requires metadata to be re-added (e.g. for 'system:time_start' so I can continue to filter variables by month or year).
The 'system:time_start' variable (and potentially others) are not displaying correctly however. When I run a $getInfo() command on an image from the terraClimate dataset, I get a value of -1 for system:time_start, yet I still am able to filter the dataset correctly. What's more, if I use this value, e.g. converting to a date object and then formatting as a YYYY-MM-dd string, the correct date appears, even though the input value was supposedly -1.
Hope this is clear enough - happy to add more info if reqired!
What I Did