Graph: Graph object

Description Details Value Fields Methods Arguments Examples

Description

This class represents an openeo process graph. It consists of ProcessNodes and optional ProcessGraphParameter. The creation of a Graph is not required in most cases, because this will otherwise be done automatically in those function that have to send a Graph representation to the openEO service. In those cases you can pass on a function that results a ProcessNode or a result node itself.

Details

However, you might want to perform an explicit cast with as(x,"Graph") in order to obtain a Graph object. 'x' can be the afore mentioned function or ProcessNode, and also a ProcessGraph object that can be obtained by describe_user_process, which parses the stored Graph representation into an openEO Graph object (parse_graph).

Value

Object of R6Class with methods for building an openeo process graph

Fields

data

a named list of collection ids or process graph parameters depending on the context

Methods

$new(con = NULL, final_node=NULL)

The object creator created from processes and available data.

$getNodes()

a function to return a list of created ProcessNodes for this graph

$serialize()

creates a list representation of the graph by recursively calling $serialize

$validate()

runs through the nodes and checks the validity of its argument values

$getNode(node_id)

searches and returns a node from within the graph referenced by its node id

$addNode(node)
$removeNode(node_id)

removes a process node from the graph

$getFinalNode()

gets the result process node of a process graph

$setFinalNode(node)

sets the result process node by node id or a ProcessNode

$getVariables()

creates a named list of the defined variables of a process graph

$setVariables(list_of_vars)

sets the process graph parameter (variables) of graph

Arguments

con

openeo connection (optional) otherwise active_connection is used.

final_node

optional the final node (end node) that was used to create a graph

node_id

the id of a process node

node

process node or its node id

parameter

the name of a parameter in a process

value

the value to be set for a parameter of a paricular process

id or variable_id

the variable id

description

a description field for a variable

type

the type of variable, default 'string'

default

optional default value to be set for a variable

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
## Not run: 
con = connect(host="http://some.url.org/openeo")
p = processes()
...
result = p$save_result(data = prior_step, format = "PNG")
graph = as(result, "Graph")

# alternative with a function (R primitve operator are translated into openEO processes)
resulting_ndvi_function = function(x) {
 B4 = x[1]
 B8 = x[2]

 return((B8-B4)/(B8+B4))
} 

graph = as(resulting_ndvi_function, "Graph")

## End(Not run)

flahn/openeo-r-client documentation built on Sept. 18, 2020, 5:16 a.m.