Closed zackarno closed 2 years ago
Hello @zackarno just add list() inside ee$List() > ee$Image(ee$List(list(first))$get(-1)) %>% ee_print( )
> ee$Image(ee$List(list(first))$get(-1)) %>% ee_print()
──────────────────────────────────────────────────────────────────────── Earth Engine Image ──
Image Metadata:
- Class : ee$Image
- ID : no_id
- system:time_start : 2016-01-01
- Number of Bands : 1
- Bands names : precipitation
- Number of Properties : 1
- Number of Pixels* : 64800
- Approximate size* : 101.25 KB
Band Metadata (img_band = precipitation):
- EPSG (SRID) : WGS 84 (EPSG:4326)
- proj4string : +proj=longlat +datum=WGS84 +no_defs
- Geotransform : 1 0 0 0 1 0
- Nominal scale (meters) : 111319.5
- Dimensions : 360 180
- Number of Pixels : 64800
- Data type : INT
- Approximate size : 101.25 KB
──────────────────────────────────────────────────────────────────────────────────────────────
NOTE: (*) Properties calculated considering a constant geotransform and data type.
amazing, thanks @ambarja for the quick reply - this works! So whenever using ee$List
you need to also use base::list
?
@zackarno yes, here some examples, maybe @csaybar could clarify this case better.
> ee$List(list(1,2,3,4,5))$getInfo()
[1] 1 2 3 4 5
> ee$List(c(1,2,3,4,5))$getInfo()
[1] 1 2 3 4 5
>
Yes, this is a typical issue due to the different coercion rules implemented in the Javascript and Python EE client libraries. The elements of the ee$List
must be either a list or a computer object. See https://developers.google.com/earth-engine/apidocs/ee-list
It seems that passing an ee.Image
object in Javascript immediately changes it to a List, however, this does not happen in the Python Earth Engine client library!, on which rgee depends.
Hello,
There seems to be an issue when using
get
on an earth engine list. Below I have created a reprex to show the issue.Below is the JS which works fine in the code editor
Here is the R code that produces the error:
Created on 2022-02-18 by the reprex package (v2.0.1)
It seems to be more than just an issue with the printing method. The reprex above might seem like it a strange process, but I have just isolated the part of my code that causes an error later when applied in an iteration. This error prevents me from replicating or modifying the GEE Iterating over an ImageCollection example with
rgee