Open-EO / openeo-r-client

R client package for working with openEO backends

Home Page:https://open-eo.github.io/openeo-r-client

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

process_viewer doesn't work with as(..., "Process")

m-mohr opened this issue · comments

The following code doesn't work:

connect(host = "https://earthengine.openeo.org")
p = processes()
s2 = list_collections()$`COPERNICUS/S2`
dims = dimensions(s2)
data1 = p$load_collection(id = s2,
                          spatial_extent = list(west=-2.7634,south=43.0408,east=-1.121,north=43.8385),
                          temporal_extent = c("2018-04-30","2018-06-26"),
                          bands = c("B4","B8"))
ndvi = p$reduce_dimension(data = data1, dimension = dims$bands,reducer = function(x, context) {
  B4 = x["B4"]
  B8 = x["B8"]
  return(p$normalized_difference(x = B4,y = B8))
})
reducer = p$reduce_dimension(data = ndvi,dimension = dims$t, reducer = function(x, context) {
  min(x)
})
apply_linear_transform = p$apply(data = reducer, process = function(x,context) {
  p$linear_scale_range(x = x, inputMin = -1, inputMax = 1,outputMin = 0,outputMax = 255)
})
final = p$save_result(data = apply_linear_transform,format = list_file_formats()$output$PNG)

udp = as(final,"Process")
process_viewer(udp)

It returns "kann Klasse von Umgebung nicht entfernen" for the process_viewer call