Post

2 followers Follow
0
Avatar

Rainfall API - Combining station & measure data in one retrieve.call

On the EA's demo site (https://environment.data.gov.uk/flood-monitoring/assets/demo/index.html) it seems like two calls are being made to the rainfall API - 1) To retrieve station data (name, X/Y location etc.) and 2) Specific measure/reading data for a station after it has been clicked.

I'm trying to display each station on a map so that the latest rainfall value is also displayed in the point's attribute table rather than in a separate table below. Is it possible to combine a call to stations & measures so that the JSON outputs the following attributes attached to a point for each station: Station name, station X/Y, latest reading?

The following URL allows me to plot all the stations around Staffordshire and I notice the attribute data contains a field called "measures": https://environment.data.gov.uk/flood-monitoring/id/stations.csv?parameter=rainfall&lat=52.8793&long=-2.0572&dist=80

Cheers

Robert Earle //

Please sign in to leave a comment.

2 comments

0
Avatar

Hello Robert, 

Thank you for your question, 

I don’t believe it is possible. It usually works by combining calls using the reference data, so obtaining the station ID and linking the call for the latest readings. The measures field is showing what is being measured at that station, so the measure would be the tipping bucket rain gauge for example.

I will however ask our suppliers to confirm.

Many thanks

Ella Fotheringham 0 votes //
Comment actions Permalink
0
Avatar

Hi Robert, 

Following on from my previous post - i can confirm it's not possible to combine the location of the station with the readings, so these need to be retrieved separately. 

The lat and long of the station is only available through the stations API call.  The readings call includes the name and identifier of the station, but not it's coordinates.

Many thanks

Data Services Platform team

Ella Fotheringham 0 votes //
Comment actions Permalink