# SMARTerra, a High-Resolution Decision Support System for Monitoring Plant Pests and Diseases
## 2 Methods
### Back-End
#### 2.2.2 Database  
InfluxDB is a time-series database (TSDB) management system, i.e., a database designed to store, query, and analyze time-varying data, selected for the SMARTerra project. Being optimized for time-series data, such as those from sensors, IoT devices, infrastructure monitoring, and other applications where understanding the evolution of variables over time is critical, InfluxDB is therefore the ideal solution for SMARTerra: it allows the immediate retrieval of time series measurements for one or more weather stations, for one or several more time points, and for a delimited area or for the whole region, thus facilitating the execution, in addition to the interpolation techniques described in Sections 2.2.3 and 2.2.4, of further interpolation methods and data analyses, such as the outlier detection technique described in [7]. In the next few years, when hopefully the SMARTerra application is more mature, no longer limited to the region of Sardinia alone, and the database contains several multiple-year time series of agrometerological variables, the capabilities of InfluxDB will be fully exploited for, e.g., calibrating the models to predict the rice blast disease infection (Section 2.2.5), the hatching date of locusts (Section 2.2.6) or any other pest or disease forecast model yet to be implemented in the DSS and enabling the implementation of other agricultural models, such as those for the growth, the yield and the planning of crops, for the automated irrigation of fields, for studying the phenology of fruits and flowers. Another advantage of InfluxDB is the ease of integrating database operations into the SMARTerra procedure via API calls. Data storage is performed in double precision, but the use of compression techniques greatly reduces the disk space required. The dedicated bucket is organized into four measurement categories (Figure 3): hourly and daily measurements from the RUR network stations and hourly time-series from the BOLAM model for the same day (hours 1 to 24) and for the next day (hours 25 to 48) forecasts.  
InfluxxDB tags are associated with the measurements to facilitate querying the time series, e.g., station name, geographic coordinates, distance from the sea, elevation above sea level (EASL), and elevation above the valley floor (EAVF). The last feature is defined, for each station \(s\), as \(\text{EAVF}_{s}=\text{EASL}_{s}-\text{min}(\text{EASL}_{s})_{3\text{km}}\), where \(\text{min}(\text{EASL}_{s})_{3\text{km}}\) is the  
Figure 3: A schematic description of the InfluxDB time-series-oriented database storing the weather measurements from the RUR network and BOLAM forecasts. After preprocessing, the data are put into the database and organized into measurements and fields. Then, the data become available for the interpolation techniques by query via API.  
minimum value of EASL evaluated within a 3 km circle around the station \(s\). The EAVF is introduced to account for the different meteorological dynamics between points with the same EASL that correspond, for instance, to a mountain peak and those lying on an upland. These additional variables are then used as the external variables in the spatial interpolation with the Kriging with External Drift technique (see Section 2.2.3).