Handbook For Open Foris Arena
Handbook For Open Foris Arena
Handbook For Open Foris Arena
ver. 1.0
Handbook
11 August 2021
Content
1. Introduction 4
6. Arena Home 10
7. Survey 16
7.3. Hierarchy 26
7.4. Categories 28
7.5. Taxonomies 34
8. Templates 36
9. Data 38
2
Open Foris Arena - Handbook
10. Analysis 50
Acknowledgements 69
Annex 3. RStudio Server: writing and downloading files created during the run-time 71
3
Open Foris Arena - Handbook
1. Introduction
Arena is an Open Foris (OF) cloud platform for forest inventory data collection, utilization, analysis,
dissemination and reporting. It combines two current tools: OF Collect and OF Calc into a seamless new
application. Open Foris Arena is the main entry point for data collected in field-based inventories. It provides
a fast, easy, flexible way to set up a survey with a user-friendly interface. Arena handles multiple data types
and complex validation rules, all in a multi-language environment.
Open Foris Arena provides an online solution for field data management, allowing full customization of
inventory structure, variables and data checks. Arena promotes data quality through an integrated data entry
and data cleansing workflow. Arena contains a formal description (i.e., metadata) of the types of variables,
classifications and coding schemes used by the inventory. Older OF Collect surveys and data can also be
imported into Arena.
The user support is available via Open Foris Support Forum at https://www.openforis.support/
Tag your question as follows:
1
RStudio is available at https://www.rstudio.com/
4
Open Foris Arena - Handbook
OF Arena can host any type of inventory data. A typical process when working with Arena will be as follows:
5
Open Foris Arena - Handbook
B. To get access to an existing survey, ask for an invitation from the Survey Administrator.
When you have got access to Arena, type in your email and password. In case you have forgotten your
password, there is an option to receive a new temporary password by email.
If you are a new user, set first your User Profile (My Profile). On the upper-right side of the screen there is a
blank icon and entry to the user profile details.
Here you can set up the following details: Title, Name (i.e., username), Email, and (access) Group. In addition,
you can add an image for your user profile.
6
Open Foris Arena - Handbook
View on the Arena main window depends on your user role (see Chapter “Users”). With the full access rights,
the left side panel contains the following tools.
7
Open Foris Arena - Handbook
My Surveys section shows a table with all accessible surveys to the user. The list contains the following
details.
Header Explanation
DATE LAST MODIFIED Date when the survey was edited last time
New Survey allows a Survey Administrator to create a new survey with three different ways: 1) Create a new
survey from scratch, 2) Clone or 3) Import a survey.
8
Open Foris Arena - Handbook
9
Open Foris Arena - Handbook
3a) An existing Arena survey, such as a backup file, can be imported into Arena.
3b) Open Foris Collect survey can be imported from a .collect file, or a .collect-backup file containing
also data. In the latter case, both survey and data will be imported. Note that after importing you
should view the Collect Import Report at the Home section. In addition, check out all the
tables/forms’ and attributes’ properties that they are in order.
6. Arena Home
2
Notice that Arena does not contain all Collect’s custom functions yet. Unsupported are e.g. env:desktop(),
env:mobile().
10
Open Foris Arena - Handbook
Labels: Label for a survey. For example a clear name for the survey.
11
Open Foris Arena - Handbook
Languages: Survey language(s). If more than one language is added, then all labels need to be given
by selected languages.
SRS: Spatial Reference Systems applied in the survey. Add here all SRSs which will be needed in
the data collection.
Hint: to add a new SRS, click the cursor into the input box and to see the options write
some letters of the EPSG code.
Cycles: Inventory cycle(s) and timing(s). Note: cycles cannot not overlap, so for example this data
is accepted:
When publishing a survey, there will be the following warning at the screen.
12
Open Foris Arena - Handbook
13
Open Foris Arena - Handbook
After importing an OF Collect survey into Arena, the Collect Import Report table shows all expressions which
need special attention, such as possible modifications. The import process can convert the most typical XPath
expressions into JS, but not complex cases. Therefore it is really essential to fix all remaining issues before
trying to publish an imported survey.
Note: you can also leave this blank, Arena can create an automatic error message.
RESOLVED: The importing process did not do the conversion. Check all unsolved issues before
publishing your survey! Mark the issue “solved” after doing the correction.
14
Open Foris Arena - Handbook
The report table can be exported into a CSV file by clicking the CSV Export button. This is probably the best
way of examining what needs to be fixed in the imported survey. In this table, there is the column ‘Resolved’
where value ‘1’ shows resolved cases, and those with blank are not converted in the importing process.
Important:
Note: In OF Collect there might be a validation rule which is logically incorrect (but still working in Collect!):
a value is checked against an attribute that is given later than the current one. An example: In Collect, the
XPath validation expression is given for “Mechantable” (height) as follows:
In this case, the Collect Import Report shows this as unresolved. The reason is that in this survey “tree_height
(Height [m])” is after “Mechantable”, as seen here below. Arena cannot handle a validation expression by
using an attribute located after in the hierarchy.
15
Open Foris Arena - Handbook
7. Survey
The Survey section is available only for a Survey Administrator. It contains the following tools:
• Form Designer: tools for creating new data entry forms, creating and editing of tables/forms and
attributes and all their properties, and to modify the visual outlook of the forms.
• Hierarchy: Viewing of survey hierarchy and the list of attributes by entities.
• Categories: Management of categorical data (i.e. code lists).
• Taxonomies: Management of taxonomic data (i.e. species lists).
Entity: Data entities are the objects of the data model such as ‘plot’ or ‘tree’. These are shown in Arena as
forms or tables. Entities are containers for attributes and relationships between objects.
Attribute: A data attribute is a unit of information inside a data entity, i.e. it is a single-value descriptor for a
data object. These are like properties of data entities: for example, an entity ‘tree’ can contain the following
attributes: species, diameter, and age.
Node (object): A node is a basic unit of a data structure, and in Arena the data structure has the shape of a
tree. A node object is represented by a single node in a tree, and it can be an element node, attribute node,
text node, or any "node type"3.
3
https://en.wikipedia.org/wiki/Node_(computer_science)
16
Open Foris Arena - Handbook
The Form Designer is a tool for designing the content and outlook of a survey. The Form Designer is a handy
tool to create a user-friendly interface for data management.
With the help of the Survey Designer, you can do following tasks with the forms:
17
Open Foris Arena - Handbook
18
Open Foris Arena - Handbook
The properties of an entity (table/form) or an attribute describe the characteristics and behavior of data
added to that object. The data type is the most important property because it determines what kind of data
the field can store. Arena supports the most common data types applied in database management systems,
and two composite data types: coordinates and taxonomic data. The data types for attributes are presented
in the following table.
File allows uploading a file (e.g. photo, audio file, video, document, etc.)
Integer
Numeric
Default number of decimal digits: 6
Note: OF Collect data type “range” (two Integer variables are created: from, to) is not supported.
Note 2: Conversion between the data types is not possible, yet. If you need to change a variable (attribute)
from Integer to Numeric, then you need to create a new variable and delete the old one. However, it is not
recommended to delete a variable if the survey is published and it contains data.
19
Open Foris Arena - Handbook
Label value
only for showing boolean data attribute
Max number of decimal
Number of decimal digits for a numeric data attribute
digits
Category Category name for a categorical data attribute
Parent Code Parent category (attribute) name for hierarchical categorical data attribute
Display As
only for categorical data attribute
Text transform
only for a text data attribute
Taxonomy Species list name (only for taxonomic data attribute)
File type
Only valid for a file data attribute
20
Open Foris Arena - Handbook
Used to add default entry values, and conditions when the table/form or attribute
is applicable.
Read Only If checked, the entry can only get the default value (as from an expression)
Default values:
Expression that creates the attribute’s value. This can be a constant value or any
Expression
valid expression. See more about expressions in Chapter “Expressions and
expression editor” and “Examples of Expressions”.
Apply if
Condition, when the expression is valid.
Relevant if Function that determines under what conditions the field is applicable
Used to automatically flag wrong entries during data entry. Using checks greatly
minimizes data entry mistakes and facilitates data cleansing.
Required If checked, the field is required
Checks that the entered values is unique (not repeated) within a specified group
Unique
of values
Code list Select a code list already created or create one
If checked, the input field won't be editable and the value will be generated at
Calculated
runtime according to the specified Default Value
Error - blocks the data entry user from submitting the record to data cleansing
Severity Warning - assigns a warning flag to the record but does not prevent submission to
data cleansing
Error messages Message to be displayed to flag error/warning (see an example below)
Apply if Allows to specify when the check is applicable (see an example below)
Expression Expression that defines the logic of the check
The Schema Summary is an exported CSV file showing a summary about the schema. It contains the list with
all entities and attributes, data types, labels, selected properties (key, readOnly, applyIf, required, validations)
and UUID (used by the database management system).
21
Open Foris Arena - Handbook
4
https://stackoverflow.com/questions/43307776/how-to-open-a-text-file-with-excel-in-utf-8-encoding
22
Open Foris Arena - Handbook
Expressions are used to determine a value. The resulting value is usually one of various primitive types, such
as numerical, string, boolean, complex data type or other types.
Arena uses the JavaScript Math object that allows you to perform mathematical tasks on numbers. Math is
a built-in object that has properties and methods for mathematical constants and functions. See the full list
of Math methods here.
Math.round(x) Returns the value of the number x rounded to the nearest integer
Math.round(9.345) = 9
Strings are useful for holding data that can be represented in text form (see link to the String object). In
JavaScript, a string is a sequence of characters enclosed in single or double quotes, and single or double
quotes are the same thing. Some of the most-used operations on strings are to check their length, to build
and concatenate them using the + and += string operators, checking for the existence or location of substrings
with the indexOf() method, or extracting substrings with the substring() method.
For example:
aString= “Vienna”;
aString.substr(0, 4) = “Vien”
aString.length =6
Similarly, Javascript objects Number, Boolean, Date, and Array can be used in the expressions.
Read more about expressions in Chapter “Examples of Expressions”.
23
Open Foris Arena - Handbook
Default land use is Crop Land (code “2”) Tree dbh measurement point (tree_dbh_point = 1.30)
Advanced editor
Pressing Ctrl+Space keys allows you to browse through the list of attributes and add them into the
expression.
24
Open Foris Arena - Handbook
Here is an example of a rather complex expression, where the tree top height is either measured directly, or
computed from angle measurements.
25
Open Foris Arena - Handbook
7.3. Hierarchy
In the Hierarchy section you can view a tree diagram that displays the hierarchical structure of your data. The
survey can contain multiple hierarchies, which are also each presented as one or more levels in the diagram.
In our example, in the next chart we have a survey for forest inventory and the nodes from all three top
levels are now displayed by labels.
When a node is selected, the application shows a list of all attributes and child entities of the selected node.
26
Open Foris Arena - Handbook
In the lower right corner, there is a button to switch the view between labels and names. The list of “bamboo”
attributes shown as names looks as follows.
There is a button to get a dropdown list of all nodes, and the attribute list can also be filtered by
the data types.
27
Open Foris Arena - Handbook
7.4. Categories
This tool is used to define lists of coded information that will be used throughout the survey to provide
options for specific fields during the data entry, data processing and reporting phases. If the user selects one
of the pre-filled templates, several code lists are loaded automatically. They include codified lists to define,
for example, accessibility, land use classes, ownership etc. These fields are set up in accordance to pre-
defined classification schemes however the user is free to add, remove or modify them. Code lists can be
used to classify a wide range of attributes such as administrative levels, personnel, topographic elements and
many more.
There can be two types of code lists: flat or hierarchical tables. A flat table contains only one level with two
columns: code and label. A hierarchical code list can be used - for example - for storing data by administrative
units (e.g., province, district, communities).
28
Open Foris Arena - Handbook
New code lists can be added in two ways: "manually" or by importing a table in CSV format.
To add a new code list click on the button. Then add the Category name.
The category names should be unique. If the category name exists, there will be a warning, as follows.
Note: in case of a flat table, Level 1 name plays no role. You can always keep it as the default name “level_1”.
A quicker option to create a new code list is to import them using a CSV file. The file should be in Unicode
(UTF-8) format.
This is the format of a CSV file for a flat table. If the survey contains just one language, then the file contains
two columns: level_1_code, level_1_[language]
29
Open Foris Arena - Handbook
If the survey contains multiple languages, then the labels need to be given by the languages as follows.
Names for the levels are only meaningful in case of hierarchical lists. This is an example of an administrative
list with three levels: province, district, and llg.
30
Open Foris Arena - Handbook
It is highly recommended to use CSV import when creating or updating a hierarchical list. The format of an
input file is as follows5.
Note: In OF Collect there can be a Specify field joined to a category, but in OF Arena there needs to be an
additional text attribute to store this extra data. This method can be used for example to specify unlisted
value(s) in the data entry.
In order to keep a separate record of the code list, it is suggested to Export the code list by clicking the CSV
Export button. This will automatically generate and download a CSV file.
While the manual process for adding code lists is perfectly legitimate and can be used for simple lists, for
more complex lists (e.g. list that have many items or with a hierarchical structure) it is strongly recommended
to prepare them in advance and upload them into Arena by clicking the CSV Import button.
5
Note: The table format is different from OF Collect.
31
Open Foris Arena - Handbook
Categories can also be used to import extra properties for categories, so they can also work as lookup tables.
This ancillary data can be retrieved from other sources, as from GIS, and imported then into Arena.
Extra properties are ancillary information that can be automatically added to the data with the help of
‘categoryItemProp’ function (see more in Chapter 136). In addition, in the data analysis, new categorical
variables can be created and then joined with a category table7. These variables can be used for data
aggregation, reporting or just for data processing purposes.
The next image shows hierarchical data in a CSV file. This can be used to import ancillary data for clusters
(level1) and plots (level2).
Currently, the extra properties can contain only the following type of data: text, numeric and geometry point.
In case of geometry point (i.e., coordinates), the spatial reference system (SRS) must be preset into the survey
(see Home section in this manual). The format of coordinate data is as follows:
SRID=EPSG:4326;POINT(X Y)
e.g. SRID=EPSG:4326;POINT(155.68 -1.48)
The best method of getting this type of ancillary data table into Arena is to create the table in MS Excel (or
equal), save it as CSV file and then import it. While importing, Arena asks to set the data type for each column
(the default is ‘text’).
6
In OF Collect this type of table is called “Sampling Point Data”, but in Arena this is a general concept and
there is no fixed name for such a table.
7
Only flat categorical tables can be used in the data analysis phase.
32
Open Foris Arena - Handbook
33
Open Foris Arena - Handbook
7.5. Taxonomies
This section allows the user to add one or more species lists by uploading a csv format file. The list should
contain all the taxonomic species that the user will select from during data entry. Species lists should be as
comprehensive as possible and should be created using all resources available in the country: local or global
databases, taxonomical books, experts’ knowledge etc. For security reasons it will not be possible to add
species during data entry. Instead, additional species should be added to the csv file (by a survey
administrator) and the updated species list uploaded to Arena.
8
In an imported OF Collect survey, column “synonym” is shown as ‘lat’ in Arena.
34
Open Foris Arena - Handbook
Optionally the user can specify other columns, such as the vernacular names of the species using the language
code (in 3 characters ISO-639-2 format, e.g. 'swa' for Swahili, 'eng' for English) as header of these columns.
Multiple values are allowed for vernacular names and they need to be separated with a slash ( / ) character.
Note: one species name (in scientific_name, synonyms or in vernacular name columns) can exist only once
in the table. So each name should have a unique species code.
In order to add a new taxon list, specify a name for the list. Then upload the CSV file, and click Done when
ready. The screen will now show the records present in the species list. Species lists can also be renamed,
deleted or exported. If needed, additional species lists can be created and uploaded in the same manner.
There are two species names automatically added to your list by the system: Unknown (UNK) and Unlisted
(UNL). Avoid entering these same names and codes into the survey.
35
Open Foris Arena - Handbook
8. Templates
Templates are surveys which contain an easy way to start designing a new survey. They are tested surveys
which will fit to specific purposes, such as forest inventory data collecting. They can be cloned when creating
a new survey.
● Only the Survey Administrator can clone a template and modify it to fit into the local forest inventory
design.
● It is easier to delete entities (tables/forms) and attributes than create them. Therefore there are
more entities and attributes in these templates than needed!
● Survey labels are stored with multiple languages. All labels can still be edited as needed, and new
language(s) can be added.
In July 2021, there are the following four templates shown in the next table in Arena (see Annex 4 containing
screenshots of these templates).
More templates will be added into Arena by FAO by the end of 2021.
36
Open Foris Arena - Handbook
When you need to create a new survey using a template, follow these steps:
1) Goto New Survey at the upper-right corner, select CLONE and a Template can be selected from the
top of the list, as follows:
2) Give a new name to your survey, and click the CREATE SURVEY button.
3) Select and edit survey properties. You can still change the survey name here.
You can also delete all unneeded languages, and add the required spatial reference systems into the
survey.
4) Go into the Form Designer, and edit the survey as needed. You can delete the unneeded entities
(tables/forms) and attributes, and add new ones into the pages.
In templates, there are typically more entities and attributes than needed, because it is faster to
delete the extra ones than to add new attributes.
Currently, only a System Administrator can add new templates. If you are a Survey Administrator and you
want to offer a new template into Arena or improve an existing one, please contact the Arena development
37
Open Foris Arena - Handbook
team by an email: [email protected], write into the Topic field: “Suggested survey to Arena
template”.
A new should be an existing, published and tested survey in Arena. It should be generic for a certain data
collection purpose. As stated above in the previous section, a good template can contain “more attributes”
than needed, because it will be easier and faster for other Survey Administrators to delete the extra
(unneeded) ones than to add new attributes in the Form Designer.
9. Data
Arena implements a workflow which divides data processing into three steps (or stages): 1) data entry, 2)
data cleansing, and 3) data analysis.
38
Open Foris Arena - Handbook
● If the data cleansing expert deems that the data entry task was not completed or that the
record contains too many errors, the record may be returned to phase 1 (entry) for additional
changes.
● Once all data errors are resolved, the record may then be submitted for data analysis. This
locks the record so that no further changes may be made.
The Records section is for entering, editing and viewing data. The main entry view for the Records section
contains a list of all entries (as root level) shown with some metadata: value of key field, Date when created,
Date when modified, Owner, Step, number of Errors, and number of Warnings.
Inputting data is straightforward. You will see all tables/forms at the left side panel, and data entry form in
the main window at the right side. Start always entering data at the highest hierarchical level. For example,
39
Open Foris Arena - Handbook
if you want to save forest inventory data where the structure is “cluster-plot-tree”, input the cluster level
data first, then the plot level etc. This guarantees the consistency of the stored data.
Arena does not lock the records (at data entry stages 1 and 2): users can work with the same data set, even
edit the same record simultaneously. All records are locked only when data is submitted to stage 3 (Data
Analysis).
Start adding a new records by clicking button. The program will open a data entry form. While
entering the data, all data are automatically written into the database, i.e. there is no ADD-button!
All items that are set as “required” are marked with a red symbol as long the input field stays blank. The
red label text and the red symbol can also indicate that there can be an error in the data item.
In case of a multiple-entry table/form, such as tree data, the new record can be added by clicking the
button next to the table/form’s name.
There are two options how to see the entities and attribute identifiers:
40
Open Foris Arena - Handbook
When working with forms that belong to lower level entities, there is a text in the upper left corner showing
the position of the record in the survey hierarchy, as follows:
Entering of species data can be handled so that starting typing in the first letters of the species name, or a
code. Then a dropdown menu will emerge and you can pick up the correct name as shown in the next image.
There are two species names automatically added by the system: Unknown (UNK) and Unlisted (UNL). In
order to enter one of these, type ‘un’ into the species name input box.
Column width in tables is fixed in Arena version 1.0, but this limitation will be improved in the coming version.
41
Open Foris Arena - Handbook
If you need to delete a record, then click it and you will get into the data editing mode. Then click on
button. This button is not visible if the data is at the analysis stage (Step 3).
A row of a table can be deleted as follows: browse to the last column of a row. There you will see a
You can click OK if you are sure. But be aware: there is no UNDO function in the system!
42
Open Foris Arena - Handbook
Data Explorer is a tool for viewing the data in the tabular format. You can view both input data and
(computed) result variables in the same table. Data can be viewed in multiple ways (such as filtered and/or
sorted), and it can be exported into a CSV file. In the EDIT MODE, data can also be directly edited at this view.
Data Explorer can be used to aggregate data. This means that it can work as a reporting tool in “Aggregate
Mode”.
The current version allows to view and export the computed result variables in the Data Explorer view (see
Chapter 9.4). Similarly as imputed data attributes, computed result variables can be selected into the view,
as below.
43
Open Foris Arena - Handbook
Data can be also aggregated to higher levels of the hierarchy. For example, tree result variables, such as “tree
volume” can be aggregated to a plot level, or any upper level.
An example how see the aggregates:
44
Open Foris Arena - Handbook
5) In the table view, we can click here the icon and change the aggregate
function.
45
Open Foris Arena - Handbook
and we can see the number of cases (Count) and the average DBH.
6) Custom aggregate functions can also be added. The aggregation uses the Structured Query Language
(SQL) expressions because this is the fastest way of processing database data via Arena user-
interface.
After clicking SAVE, we can see the list of custom aggregate functions as follows:
The reported custom aggregates need to be selected in order to see them in the report table.
46
Open Foris Arena - Handbook
8) Data view can now be exported a CSV file and download to the local machine.
All data (excluding file type data) of the current survey can be exported into a zip file that contains several
CSV files. The zip file contains all attributes grouped by entities. In the left side panel click on EXPORT and
After exporting the data into the server, still download it by clicking the button.
The next image shows an exported file containing forest inventory data.
47
Open Foris Arena - Handbook
If a survey is created in OF Collect, and this survey is imported into Arena and published, data can also be
imported into the Arena (later). This enables collection of data using OF Collect Mobile in data collection.
Note: The checkbox “delete all records before import” means that all records in the target survey will be
deleted. Be cautious while using this selection!
Selection “Force import from another survey” allows importing data from a collect-data file, which may have
different survey name in Collect than in Arena, but the same schema (i.e. schemas can match).
9
In the later Arena version there will be a selection that only Entry, Cleansing or Analysis level data can be exported.
48
Open Foris Arena - Handbook
Errors in data can be detected by several means. While editing the data in Data Records, there can be an
error message indicating that there is something wrong in the data. However, there is no
easy way to find the erroneous data in the Data Records. So for searching and browsing the erroneous data,
we should use the Validation Report tool.
The data validation report is a table that is created by running through all data validation checks in the survey.
It is essential to run this report and fix all errors in the data before the data enters the Analysis phase. Note:
if your data is already at the Analysis step , you cannot not edit the records. You need to
submit the record back to Step 2.
The validation report shows all records that have issues, either ‘Warning’ or ‘Error’. The Error message will
be automatically generated, if the custom “Error Message” is left blank in the survey designing phase.
The erroneous records can be directly accessed and edited from the Validation Report view.
49
Open Foris Arena - Handbook
10. Analysis
The data processing in Arena is handled with the help of R language script. Each survey has unique scripts,
and the Survey Administrator can add and modify the scripts. The data processing can be run using RStudio
in the cloud, or locally with R and RStudio installed in the personal machine.
In Arena version 1.0, the data reporting (aggregating) part is still under development and the full
implementation will be ready by the end of 2021.
Data processing can be conducted with the help of a calculation chain, which contains calculation of result
variables. We call these variables as modules in this manual. A survey can contain more than one calculation
chain, if needed.
A chain must contain at least one result attribute, so create that next. First, select the table/form which will
contain the new result variable:
50
Open Foris Arena - Handbook
From the above list, ‘Trees’ is selected. Then we need to select whether we give a quantitative or categorical
variable.
Fill in the variable’s name10, label and number of decimal digits. The script can be left as it is at this point,
because it can be written later in RStudio. Then click the SAVE button, and then the BACK button.
Note: In the label text (C) means that this is a calculated attribute.
ACTIVE means that this variable is computed while processing the data. The variable can be also
deactivated if it is not needed but we want to keep it here.
10
If you are working with forest inventory data, please see the recommended naming approach in “Naming of
entities, attributes and variables in Collect / Calc” at http://www.openforis.org/materials/
51
Open Foris Arena - Handbook
Categorical data can be used for reporting (i.e. for aggregation) or in the computing chain. Add a new
categorical result variable by first clicking the entity that contains this variable. Then click the
button.
Fill in the name and label. The categorical variable needs to be linked with an existing categorical table, and
only a join with a flat category table is allowed! If the category table does not exists yet, it can be created
with the button. If the category table exists already, click the button, select the category
from the list and click the button and then the button to close the list. Then click the
Note: the order of computed variables may be really important! For example, in forest inventory case above-
ground biomass needs to be computed before computing the below-ground biomass. The order of variables
can be changed by moving the cursor on the top of the icon on the left side of the name, and drag-and-
dropping the variable to the right location.
52
Open Foris Arena - Handbook
When all result variables are created, the survey needs to be published. Run .
53
Open Foris Arena - Handbook
The R scripts can be written, debugged and run using RStudio integrated development environment (IDE) for
R. Arena offers two options how to use RStudio:
Arena will automatically copy the initialization script to your clipboard 11.
11
The initialization script is valid for 60 minutes, then it will expire.
54
Open Foris Arena - Handbook
Note about local RStudio: If you do not see this view, click the Files tab, and run this command in the
R Console: rstudioapi::filesPaneNavigate(getwd())
The file 001-init.R contains system initializing commands, as access to the database management
system. In Rstudio Server, it also installs a great number of packages into your RStudio session. In
local RStudio, only a few essential packages are installed (if they have not been installed already 12).
The list of all installed packages can be viewed here: [home]/system/init/init-packages.R
Running this script takes a few seconds, when a new RStudio session is opened. Next time running
this script goes faster.
The file 002-login.R opens two input boxes in order to get access to your data in the Arena
database: first type your username (email) to Arena, and then into the second inputbox your
password. For security reasons your credentials are not shown in plain text.
12
The list of packages can be found at /system/init/init-packages.R
55
Open Foris Arena - Handbook
After a successful login, you should get a message to the Console screen, such as
source('system/003-read-data.R')
This will initialize the variables (as data frames) and download the data. See the Environment
window in RStudio.
This folder contains the common file for adding R scripts (as functions) that are common for all scripts
(modules) following file 004-common.R
● Try to write all package loads into 004-common.R, because it will be the easiest to manage
them in one file.
● RStudio RServer is running on a Linux machine. Some packages may not run on Linux.
● While calling new packages, avoid using the ‘library’ command. Instead, use the command
‘usePackage’. This is a function, which checks whether a package is preinstalled. If not, then
it will be installed. This is the usePackage-function code (located in a system file called as
init-packages.R):
● Because (in RStudio RServer) there are a high number of (active) packages, it is better to
write the package name in the front of a function, whenever you call the function. For
example:
56
Open Foris Arena - Handbook
9) All files in the folder /user and below are the ones that will require working. For working methods
with the R-scripts, please see hints in the OF Calc manual (from p. 39)13.
In the RStudio project, all data are in dataframes by entities. In addition, there are the following two
lists (of data frames): categories and taxonomies. For example: if the survey contains a code list
‘land_use’, it can be accessed as a data frame as follows: categories$land_use.
10) When all scripts are tested, saved, and can run error-free, you need to run the source code of the
main program. So select window of arena.R and run the
This will return all R scripts and write computed results data back to Arena’s database.
11) RStudio Server: After a successful run, you can close your RStudio session. Go to the Arena’s main
Terminating the connection will release server resources to other RStudio users in the cloud.
It means that the RStudio Server instance cannot start at this moment. In this case, wait for 5-10 minutes and
try again. This may happen in cases where there is a high number of users trying to access the system at the
same time.
If you work with the Studio Server and want to create new files during the run-time, such as CSV files or
graphic files, please see the guidance at Annex 3.
13
During 2021, online video tutorials will be available on how to write scripts into Arena. Also later the templates
containing embedded R scripts will be available to facilitate the data processing part.
57
Open Foris Arena - Handbook
Each survey is hosted by one or more Survey Administrators. A Survey Administrator can invite new users by
sending an invitation email from Arena.
In order to become a Survey Administrator, please go to www.openforis-arena.org and click on the Request
Access link:
Fill the form, send the request and wait for the request to be approved. You will receive an email with the
details on how to access Arena.
58
Open Foris Arena - Handbook
The users are divided into the following roles, each of them having different access rights to the tools, surveys
and data.
59
Open Foris Arena - Handbook
Permission Survey Survey Editor Data Analyst Data Cleanser Data Editor
Administrator
Survey Create X
Clone X
60
Open Foris Arena - Handbook
The survey administrator can invite new users to get access to OF Arena and to the current published survey. The invitation is sent to an email address.
If people do not get an email invitation, the message might be blocked by a strict firewall filter on the recipient’s end. Ask the recipient to check their spam, junk,
and clutter folder for the invitation message.
61
12. Examples of expressions
Arena uses Javascript programming language for expressions. Because some users may be familiar with XPath language expressions used in OF Collect, the
next tables represent expressions with both these languages.
Note: In JavaScript, a string is a sequence of characters enclosed in single (‘) or double (“) quotes. The choice of quoting style is up to the programmer.
A2 Attribute “stem form” is relevant is plant /cluster/plot/tree/tree_form tree_type != ’PALM’ tree_type != ”PALM”
type is not a palm
A3 Attribute “stem form” is relevant if a tree is /cluster/plot/tree/tree_form tree_status = ’LIVE’ and tree_dbh>=40 tree_status == ”LIVE” &&
living (tree_status=‘LIVE’) and DBH more or tree_dbh >= 40
equal to 40cm (tree_dbh>=40).
A4 Trees and stumps are collected in the same /cluster/plot/tree/ stump stump==true
form: Stump diameter is only recorded for tree_ stump_diameter stump=true()
stumps (i.e. boolean attribute ‘stump’ is
TRUE).
A6 Trees and stumps are collected in the same /cluster/plot/tree/tree_ not(stump) and !stump && Number(tree_condition) > 1
form: “Causative agent” is only recorded for causativeagent number(tree_condition)>1
Open Foris Arena - Handbook
idm:not-blank(attribute_name) !isEmpty(attribute_name)
Checks if an attribute is not empty
A9 Tree top height only required for every third /cluster/plot/tree/tree_height_top tree_id mod 3 = 0 (tree_id % 3) == 0
tree
63
Open Foris Arena - Handbook
- tree_species/@code, - tree_species.code,
● taxon tree_species/@scientific_name, tree_species.scientificName,
tree_species/@vernacular_name tree_species.vernacularName
● file
- my_file. fileName, my_file.fileSize
● date
- my_date/@year, my_date/@month, - my_date.year, my_date.month, my_date.day
● time my_date/@day
64
Open Foris Arena - Handbook
B7 Get inputted value from another table from Source table: seasonal_calendar parent()/seasonal_calendar[idm:positi seasonal_calendar[index(product_unit)].seaso
one of its field (seasonal_product), with the Source attribute: on($context)]/seasonal_product nal_product
same row position seasonal_product
Target table: product_unit
Target attribute:product_name
/community/product_unit/product_
name
B13 Calculate slope percent from degrees /cluster/plot/slope/slope_percent math:tan( slope_deg * 3.141592654 Math.tan( slope_deg * 3.141592654 / 180) *
div 180) * 100 100
B14 Area of circular plot, radius 18m 3.141592 * math:pow(18,2)) Math.PI * 18**2
65
Open Foris Arena - Handbook
B17 Display the desired column from the species idm:speciesListData("SPECIES_LIST_NA (not implemented yet)
list ME", "column_list",
TAXON_ATTRIBUTE_NAME)
B18 Calculate cumulative sum of basal area: /cluster/plot/tree/tree_cum_ba sum(parent()/tree[tree_num < (not implemented yet)
sum the basal area of the inserted trees & $this/parent()/tree_num]/tree_basal_
a calculated attribute inside of it area)
"tree_num" with the position of the
tree, i.e in XPath. idm:position()
B20 Distance from actual to expected plot center /cluster/plot/expected_plot_loc_dist idm:distance(plot_location, distance(plot_location,
ance expected_plot_location) expected_plot_location)
B21 Compute the mean canopy closure (%) using /cluster/plot/mean_canopy_percent 100 - 1.04 * sum( 100 - 1.04 * (
a densiometer with 24 squares, four parent()/canopy_cover/canopy ) plot.canopy_cover[0].canopy +
plot.canopy_cover[1].canopy +
measurements in a plot Explanation: 24 squares x 4 plots = 96, plot.canopy_cover[2].canopy +
and 96 x 1.04 approx. = 100. plot.canopy_cover[3].canopy +
Attribute ‘canopy’ is given as number plot.canopy_cover[4].canopy
of squares that are under the direct )
sunlight (i.e. not shaded by trees)
66
Open Foris Arena - Handbook
C3 Plot elevation must be between 0 and /cluster/plot/details/plot_elevation 0 <= plot_elevation <= 4000 0 <= plot_elevation && plot_elevation <=
4000 m 4000
C4 Date must be current or earlier than current /cluster/start_date start_date <= idm:currentDate() start_date <= now()
date
C5 Working hours for the survey should be /cluster/start_time 0600 < start_time <= 1900 "06:00" < start_time < "19:00"
from 06:00 to 19:00
C6 End time should be after start time /cluster/end_time end_time >= start_time end_time >= start_time
(Here we assume that start_time and end_time are
under the same entity)
C7 Tree number must be greater than zero /cluster/plot/tree/tree_no 0 < tree_no 0 < tree_no
67
Open Foris Arena - Handbook
C8 angle must be between 0 (inclusive) and /cluster/plot/tree/tree_azimuth 0 <= tree_azimuth < 360 0 <= tree_azimuth && tree_azimuth < 360
360 (exclusive)
C9 Tree distance in a plot must be positive /cluster/plot/tree/tree_distance 0 <= tree_distance 0 <= tree_distance
68
Acknowledgements
The Open Foris Arena platform has been built with the support of the Government of Norway and the UN-
REDD Programme through the Food and Agriculture Organization of the United Nations (FAO).
The deepest thanks to the developers of the system: Cosimo Togna, Stefano Ricci, Ramiro Blazquez-Gonzalez,
Lauri Vesa, Miró Sorja, Stefano Giaccio and Elias Kunnas. The Arena logo was designed by Jérôme Agostini.
The other contributors in the development have been Rebecca Tavani, Inge Jonckheere, Julian Fox and Anssi
Pekkarinen.
OF Arena is built with JavaScript programming language and the system is based on the following
components:
• System front-end and back-end will communicate via Web Socket connection, and the OF
authentication system uses local user storage. OF sends notifications via email.
OF Arena uses cookies, so they should be allowed in the web browser. The system is tested with the following
web browsers: Google Chrome (recommended), Windows Edge, Opera and Safari.
Open Foris Arena - Handbook
ID Identifier
JS Javascript
OF Open Foris
R Programming language
70
Open Foris Arena - Handbook
Annex 3. RStudio Server: writing and downloading files created during the
run-time
Because RStudio Server works on a remote server, getting files, such as CSV files or graphic files, created by
the R scripts from the server to the user’s machine requires special methods. Here we go through how to do
this.
Optionally, you can also use a function to add all “user’s files” into a zip file (arena_R_export.zip)
which can be downloaded (after running the project files). Add also this script into 004-common.R
(after the script above):
2) in the part where you need to write something into a CSV file, use this type of command line
71
Open Foris Arena - Handbook
3) To download the files from the server, there are two methods:
a) using RStudio’s EXPORT tool (this is easier),
b) or by R coding.
# make a pause before exporting the next file, otherwise there can be a pop-up warning
if (i > 1) {
cat('*** PRESS ENTER HERE')
readLines(stdin(), 1)
}
72
Open Foris Arena - Handbook
template_forest_inventory_b
Template B:
73
Open Foris Arena - Handbook
test
template_forest_inventory_c
Template C:
74
Open Foris Arena - Handbook
template_forest_inventory_d
Template D:
75
Open Foris Arena - Handbook
template_forest_inventory_e
Template E:
76
Open Foris Arena - Handbook
77
Open Foris Arena - Handbook
Food and Agriculture Organization of the United Nations ("FAO", "us", "we", or "our") operates the Open
Foris Arena website (the "Service").
This page informs you of our policies regarding the collection, use, and disclosure of personal data when
you use our Service and the choices you have associated with that data. This Privacy Policy is powered
by FreePrivacyPolicy.com.
We use your data to provide and improve the Service. By using the Service, you agree to the collection and
use of information in accordance with this policy. Unless otherwise defined in this Privacy Policy, terms
used in this Privacy Policy have the same meanings as in our Terms and Conditions, accessible from
https://www.openforis-arena.org/
We collect several different types of information for various purposes to provide and improve our Service
to you.
Personal Data
While using our Service, we may ask you to provide us with certain personally identifiable information that
can be used to contact or identify you ("Personal Data"). Personally identifiable information may include,
but is not limited to:
● Email address
● First name and last name
● Associated organization
● Title
● Cookies and Usage Data
Usage Data
We may also collect information on how the Service is accessed and used ("Usage Data"). This Usage Data
may include information such as your computer's Internet Protocol address (e.g. IP address), browser type,
browser version, the pages of our Service that you visit, the time and date of your visit, the time spent on
those pages, unique device identifiers and other diagnostic data.
We use cookies and similar tracking technologies to track the activity on our Service and hold certain
information.
78
Open Foris Arena - Handbook
Cookies are files with a small amount of data which may include an anonymous unique identifier. Cookies
are sent to your browser from a website and stored on your device. Tracking technologies also used are
beacons, tags, and scripts to collect and track information and to improve and analyze our Service.
You can instruct your browser to refuse all cookies or to indicate when a cookie is being sent. However, if
you do not accept cookies, you may not be able to use some portions of our Service.
Use of Data
Transfer of Data
Your information, including Personal Data, may be transferred to and maintained on computers located
outside of your state, province, country or other governmental jurisdiction where the data protection laws
may differ from those of your jurisdiction.
Your consent to this Privacy Policy followed by your submission of such information represents your
agreement to that transfer.
We will take all steps reasonably necessary to ensure that your data is treated securely and in accordance
with this Privacy Policy and no transfer of your Personal Data will take place to an organization or a country
unless there are adequate controls in place including the security of your data and other personal
information.
Disclosure of Data
Legal Requirements
We may disclose your Personal Data in the good faith belief that such action is necessary to:
79
Open Foris Arena - Handbook
Security of Data
The security of your data is important to us, but remember that no method of transmission over the
Internet, or method of electronic storage is 100% secure. While we strive to use commercially acceptable
means to protect your data, we cannot guarantee its absolute security.
Service Providers
We may employ third party companies and individuals to facilitate our Service ("Service Providers"), to
provide the Service on our behalf, to perform Service-related services or to assist us in analyzing how our
Service is used.
These third parties have access to your Personal Data only to perform these tasks on our behalf and are
obligated not to disclose or use it for any other purpose.
Analytics
We use third-party Service Providers to monitor and analyze the use of our Service.
● Google Analytics
Google Analytics is a web analytics service offered by Google that tracks and reports website traffic.
Google uses the data collected to track and monitor the use of our Service. This data is shared with
other Google services. Google may use the collected data to contextualize and personalize the ads
of its own advertising network.
You can opt-out of having made your activity on the Service available to Google Analytics by
installing the Google Analytics opt-out browser add-on. The add-on prevents Google Analytics
JavaScript (ga.js, analytics.js, and dc.js) from sharing information with Google Analytics about visits
activity.
For more information on the privacy practices of Google, please visit the Google Privacy & Terms
web page: https://policies.google.com/privacy?hl=en
Our Service may contain links to other sites that are not operated by us. If you click on a third party link,
you will be directed to that third party's site. We strongly advise you to review the Privacy Policy of every
site you visit.
We have no control over and assume no responsibility for the content, privacy policies or practices of any
third party sites or services.
Children's Privacy
Our Service does not address anyone under the age of 18 ("Children").
We do not knowingly collect personally identifiable information from anyone under the age of 18. If you
are a parent or guardian and you are aware that your Children have provided us with Personal Data, please
80
Open Foris Arena - Handbook
contact us. If we become aware that we have collected Personal Data from children without verification of
parental consent, we take steps to remove that information from our servers.
We may update our Privacy Policy from time to time. We will notify you of any changes by posting the new
Privacy Policy on this page.
We will let you know via email and/or a prominent notice on our Service, prior to the change becoming
effective and update the "effective date" at the top of this Privacy Policy.
You are advised to review this Privacy Policy periodically for any changes. Changes to this Privacy Policy are
effective when they are posted on this page.
Contact Us
If you have any questions about this Privacy Policy, please contact us by
email: [email protected]
Open Foris Arena is developed and hosted by the Forestry Division, FAO
81