OpenWeatherMap Module

I was using the OpenWeatherMap API for an automation project and I seen they also provide weather map layers, so I adapted the Mapbox Module to add these as additional layers.

The layers are not particularly interesting at farm zoom level, but perhaps could be useful with a map zoomed out to cover the greater region. Could probably make more sense eventually to create a weather page perhaps with forecast widget and the possibility to record weather data from the API and/or manual sources/sensors etc.

3 Likes

This is awesome @Farmer-Ed! I wonder if we should consider merging these layers into the farm_weather module (which still needs to be ported to v2). I’ve always figured that could become a more general module that provides lots of weather features.

One of the considerations with a weather module is where data is/isn’t accessible. For example, the NRCS module adds soil survey layers, but only for the United States. So making sure we think globally is always important when we create “general” modules. :slight_smile:

1 Like

FWIW I’ve also considerred merging farm_weather into farmOS core… I could see it being a few modules actually. farm_quick_weather for the precipitation quick form, maybe farm_map_weather for the OpenWeatherMap layers? (Similar to how we include OpenStreetMap layers in default farmOS)

1 Like

Speaking of weather it’s worth mentioning the Norwegian YR service. They are worth following.
It’s a free and open weather-service.

https://developer.yr.no/

I believe OpenWeatherMap is a global service, I know their Irish weather Data is just taken directly from the MET Éireann API which I could just as easily access, but at least using OpenWeatherMap a module should be more general. A core weather module or modules would be cool too.

I looked at the NRCS module too, obviously it unfortunately is not much use to me, there is soil data available here but adding it to a map may be a challenge, I was considering creating a custom map for my use using mapbox then bringing it into farmOS, my working with the OpenWeatherMap module is as much about experimenting with importing existing layers before I try creating my own custom ones.

1 Like

Yes and I have used it previously, I don’t think they have the weather layers ready to import into farmOS as easily as the OpenWeatherMap does, but could definitely be worth another look.

1 Like

Actually @mstenta I may have been wrong the Irish EPA have soil data in WMS format that works with your NRCS module by just changing the URL

@pat I Had another look at yr.no/met.no API’s and it looks like they are working on a WMS service. WeatherAPI documentation | MET Weather API but it says under construction.

image
Very little information in the link other than more likes on general information on what WMS is.

But I found this weatherapi-docs/PublicWMS.md.disabled at master · metno/weatherapi-docs · GitHub in their GitHub so had a play anyway.

They have a lot of different map layers to choose from but they all end up missing tiles on rendering, not sure if this is the “under construction” bit or just me :smiley: it’s different area’s at each zoom level.

Some off the layers are just the Nordic region though and even layers with global layers revert to Nordic if the Time parameter is used to select a time over an hour in the past.

Could be interesting though in the future when the Service launches officially.

I wonder if the Agstack API mentioned by @mstenta will serve any map layers? AgStack Weather API in alpha

@mstenta or @Symbioquine I presume the farmOS Map only renders once per page load for performance reasons which would make sense for most Mapping and survey layers, but can a weather module periodically call the map to re-render to track weather systems? or would that require some modification of the core map module?

Of course I could always cheat and use a windy.com iframe :smiley:

Hah… cool.
For Norway (maybe a bit around too), Yr has a radar-map that visulaiszes the cloud movements. Thats quite useful, but not exactly global…

I wonder: Could the missing tiles be related to my problems with canvas blocking in firefox?
When I click a place on the map, the hotspot is a bit off, and selects something else.

In Brave browser this works fine.

This thing gives me some problems of different type now and then.

1 Like

There is plenty of API’s that do this, but doing it well on a free tier could be another story. OpenWeatherMap has far more layers on a Premium tier but I’m not sure I’d need these features badly enough to pay.

1 Like

Correct - there is no logic currently for “auto-updating” layers. Could be useful to open an issue in the farmOS-map issue queue for this: Issues · farmOS/farmOS-map · GitHub

In the meantime, page refresh would be necessary to update.

Curious how often the layers themselves get updated… :thinking:

1 Like

It’s probably not going to be a major issue to be fair, most free API’s will probably be hourly or half hourly probably more frequent for some premium sources. But a more advanced use case might be forecast layers so the ability to refresh the map based on a time input may be useful without needing to refresh the entire page.

Oh! This reminds me of the long-standing feature request for a “timeline slider for layers”! :slight_smile:

3 Likes