Using the Environment Agency Real Time Data API in InfoWorks ICM, ICMLive and Infinity Systems

The English Environment Agency provide a flood-monitoring API (Application programming interface which allows software to access the data directly) which provides access to near real-time information including measurements of rainfall, water levels and flows.

Water levels and flows are regularly monitored, usually every 15 minutes. Data is then transferred back to the Environment Agency at various frequencies, depending on the site and level of flood risk. The APIs are provided as open data under the Open Government Licence with no requirement for registration.

InfoWorks ICM and ICMLive can connect to the Environment Agency flood monitoring API using a Time-Series DataBase (TSDB). Time Series Databases are described in the following blog post:-

http://blog.innovyze.com/2016/09/26/working-with-time-series-databases-tsdb/

The TSDBs can then be connected to via a web-browser using the Infinity Systems software described on the following page:-

(http://www.innovyze.com/products/infinity_system/)

In InfoWorks ICM version 8, a new data source type, EA RestAPI, was added which allows connection to the Environment Agency Real Time Data API for the river levels. To set up a connection, the first step is to configure a TSDB data source with a type, EA RestAPI and the server set to environment.data.gov.uk. The data source name can be set accordingly.

Figure 1: TSDB Data Source Configuration for EA RestAPI data

Now in the Observed data tab, configure a data stream to look up the data source set up above. The key component will be the Table which will be station ID for the gauge that data is required for. In the below image, the table ID is 2001TH which is the Benson Lock gauge in Preston Crowmarsh, a short distance from our Wallingford Office in Oxfordshire.

Figure 2: Observed Data Stream Configuration for EA RestAPI data

A list of station IDs is available from the Environment Agency webpage:-
http://environment.data.gov.uk/flood-monitoring/doc/reference#stations

Right click on the data stream and choose ‘Test Connection’. Hopefully, you will get a response that the connection is ok. Next, right click on the data stream and choose ‘Update Data’. This will update the data associated with the data stream. By default this is a background process which will run external to the InfoWorks ICM/ICMLive user interface and pull the data from the API into the TSDB for the period specified, so in the instance below between the 1st and 30th January 2018.

Figure 3: Update TSDB Data Dialog Box

Once the data retrieval is complete, then you can view the time-series data, as well as graphing the data for the period of data.

Figure 4: River Level Data from the Benson Lock gauge for the period 3rd January 2018 to 30th January 2018. Acknowledgement: This uses Environment Agency flood and river level data from the real-time data API (Beta).

The data can also be accessed with Infinity Systems. The below image shows the gauging stations which provided data on the 29th January 2018.

Figure 5: EA RestAPI Gauges in Infinity Systems

The data would then be periodically updated and then the data can then be graphed, analysed and interrogated within Infinity Systems with notifications generated as required.

Figure 6: River Level Data from the Benson Lock gauge for the period 3rd January 2018 to 30th January 2018 and mapped location as shown in Infinity Systems. Acknowledgement: This uses Environment Agency flood and river level data from the real-time data API (Beta).

Also, once in the TSDB, the data can then be used in a simulation by using a TVD connector to provide the link between the TSDB data stream and an object in the network. The TVD connector can be used to represent to represent boundary conditions (ie, level boundary) or observed data for comparison with the simulated data. Currently the EA RestAPI data type only obtains observed data from the river level data. It is possible to access other data but this requires the development of a Ruby Script to be used within the TSDB.

Share this post!

    About Duncan Kitts

    Duncan Kitts is a Senior Support Engineer with Innovyze in the United Kingdom, specializing in River modelling and 2D modelling. He has over 9 years experience of modeling the key hydraulic processes involved in both fluvial systems and urban drainage environments. Duncan is responsible for providing support of both infoworks ICM and Infoworks RS.
    This entry was posted in ICMLive, InfoWorks ICM, Wastewater and tagged , , , , , , , , , . Bookmark the permalink.