Sensor Things API QGIS core provider

12:2015 mins08/11/2024

Sensor Things API (STA, in short), is an OGC specification for storing and retrieving (timeseries of) Sensor Observations.

FROST-Server, developed by Fraunhofer IOSB, is one of the most consolidated implementations of STA with a very detailed documentation and a lot of background information. The implementation includes a REST endpoint to insert, modify and retrieve STA entities with a query language based on OASIS Odata URL patterns and query options.

A QGIS experimental plugin, developed by Deda Next srl in 2022 and implemented in python within the EU project Air-Break, is currently available to connect to STA-compliant endpoints and retrieve sensor data (e.g. European Air Quality data from this endpoint). The plugin has an embedded data provider which is currently designed to retrieve sensors’ locations as geometrical features and then request the time series of observations for specific locations.

However, in order to offer support to a wider range of use cases and more complex queries on STA model entities, Faunalia and DedaNext (funded by BRGM) started to plan for a dedicated STA data provider for GIS: a development group was set up involving the QGIS community, formal acceptance of the proposal was sought within the QGIS community (QEP #257) and possible development options for the provider (ex: python vs C++) were analyzed. As STA is an OGC standard, it seemed appropriate to implement it in C++ as a core element of QGIS.

Development has therefore been carried out in close interaction with the QGIS developer community with the focus on supporting complex STA queries, implementing among other things:

– expansion of relations among model entities;
– independent attribute filtering and sorting on all entities;
– efficient data caching to limit unnecessary data transfers;

This new core element is available from QGIS version 3.37 (currently only available as nightly release).

Finally, plans are underway to develop a new version of the QGIS STA plugin (originally developed by Deda Next within project AirBreak) focused on data exploration and analysis that will be able to leverage on the newly released core STA data provider to support a wider range of use cases, such as:

– Time series analysis: This is the case of the old STA plugin. Fetch Locations, show them on the map. Then, upon selection of one location, fetch all related Things and Datastreams, and finally, fetch the Observations of the desired Datastream to be shown in a table or plot;
– Space-time series analysis: Given a selected set of Datastreams from a moving sensor, get all the FeaturesOfInterest of those Datastreams and plot them on the map, so to have a view of the path of the moving sensor and a hold on its values on every part of that path;
– Monitoring and inspection: Fetch all the latest observations of all Datastreams (or a selection based on the ObservedProperty) and show these at their Locations, styled by the result of the latest Observation of a given ObservedProperty. Then, in a second phase (eg. if a value is over a threshold), inspect the full timeseries of that one Datastream.
– Tracking of moving things: Show all Things with their current Location and their HistoricalLocations with the Temporal Controller (time slider).