Page 1 of 1

River levels block

Posted: Sat Jan 27, 2018 10:58 am
by shawn
Hi Guys, How easy would it be to have a river level block? Bit like the tides block.

Re: River levels block

Posted: Sat Jan 27, 2018 6:40 pm
by EveshamWeather
It would need a reliable data source from which data can be extracted. I have quickly looked at the Environment Agency website for the UK and there is an API for flood warnings, which may also give river levels in there somewhere - https://environment.data.gov.uk/flood-m ... /reference.
A quick search on Evesham has not returned any data for river level though (https://environment.data.gov.uk/flood-m ... wn=Evesham) so it may not be possible to get the information required from this api but it will need further investigation. Edit to add, I have found the river level (http://environment.data.gov.uk/flood-mo ... 5_min-mASD or https://environment.data.gov.uk/flood-m ... eter=level - the value field listed under the latest reading section) which appears to be accurate to what the web page levels show. The downside I found is that not all stations have a river level, and the station ID (2002 for Evesham) is not always the same for the API and the EA website (Slad Brook Merrywalks is 2204 on the website but 2206 on the API) so it will not be easy for anyone to find the required station ID to use the API.

This data source could be used for providing a flood warnings block though I guess.

Also it appears this API will only work for England. Welsh levels have an API @ https://api-portal.naturalresources.wales/ and there are separate agencies controlling data for Scotland and NI.

Re: River levels block

Posted: Sun Jan 28, 2018 12:19 pm
by shawn
Thanks for your reply Vince.

I use this site www.riverlevels.uk/river-avon-evesham#.WmzuQahl9PY to monitor the river by me and i was wondering if a block could be made with the same info at the top of the page and the 2 graphs further down?



Shawn

Re: River levels block

Posted: Sun Jan 28, 2018 12:31 pm
by EveshamWeather
That site looks like it uses the API's I listed and generates the data from those, so it would be possible to create a block (for current information) and possibly a plugin giving more detailed information (like history graphs etc). Jachym may be able to sort something way faster than I can though (as I need to do some learning first!).

Re: River levels block

Posted: Sun Jan 28, 2018 2:39 pm
by shawn
Yes same, I need to go back a few years and relearn. My head is spinning just looking at the code :-/

Shawn