Meteoalarm Europe Beta

Using the The list of updated scripts after October 31, 2023 one can now download the latest beta of the updated MeteoAlarmEurope scripts.

  • You can use multiple lat-lon areas
    → setup in wrnWarningEU.php
    → check lines 15 → 30 of the code
  • And still use multiple geocode areas
    → as setup in your current easyweather-settings

Use these scripts if you really need them.
Some countries, see next post, already switched from ID’s to polygons only.
Backup your current wrnWarningEU.php script.
The other 3 scripts for CAP, RSS and ATOM, have a new name.

Test these scripts if you want to help me testing them, but better not on your “production” website.

If you have no download token but you need to test these scripts, sent a PM and I will sent you the scripts.


Background:
MeteoalarmEurope is rapidly moving towards a new CAP data structure probably end of the year. There is no documentation what they want to change, but it will be a very busy period :grimacing: early next year.


Drawbacks for us:

  1. More website-hosting resources - longer response times
  2. New extra hazard types, we have to find graphics for those
  3. Extra translation-problems for more and longer hazard-descriptions

File size problems:
The 5 characters of the current geocode are replaced with a polygon of 6.500+ characters and that for every language used. 5 languages * 6.500 extra characters.
A Swiss warning has grown from less than 6.500 characters to over 39.000 characters.

Currently the Swiss download from the Swiss servers takes 18-19 seconds to finish. https://feeds.meteoalarm.org/api/v1/warnings/feeds-switzerland
Often the browser will end with a message “website is not responding”
I sincerely hope that the scripts will also work with “cheaper” hosting packages.
The Swiss download has 879 warnings and the size is 33 mb. That is 5 times larger than the next , the Netherlands, although that country has a ridiculous 3.618 warnings but the file-size is 6 mb. If the Netherlands would switch to polygons the file would grow to over 100 mb? Which hosting company will allow us to download even one 100+ mb file every 15 minutes?


Wim

1 Like

Links / more information:


Demo site current 2012_lts release
As Switrzerland is included the wait time can be > 20 seonds

Meteoalarm user area: links to documentation

MeteoAlarm NEWS


Other post of interest → Ken True


code Country Geocode Polygon Geocode ToDo
AT Austria EMMA Geocode
BA Bosnia-Herzegovina EMMA Geocode - -
BE Belgium EMMA/NUTS Geocode Alias
BG Bulgaria EMMA/NUTS Geocode Alias
CH Switzerland EMMA Polygon - -
CY Cyprus EMMA Geocode - -
CZ Czechia EMMA/NUTS Geocode Alias
DE Germany EMMA Geocode - -
DK Denmark EMMA Geocode - -
EE Estonia EMMA Geocode - -
ES Spain EMMA Geocode - -
FI Finland EMMA Geocode - -
FR France NUTS Geocode Alias
GR Greece EMMA Geocode - -
HR Croatia EMMA Geocode - -
HU Hungary NUTS Geocode Alias
IE Ireland FIPS ? Geocode Alias
IL Israel EMMA Both ? - -
IS Iceland EMMA ? Both - -
IT Italy EMMA Geocode - -
LT Lithuania EMMA/NUTS Geocode Alias
LU Luxembourg EMMA Polygon - -
LV Latvia EMMA/NUTS Geocode Alias
MD Moldova ? ? ?
ME Montenegro EMMA ? ?
MK RO North-Macedonia NUTS ? ?
MT Malta ? ? ?
NL Netherlands EMMA Geocode - -
NO Norway EMMA/NUTS Polygon ? Alias
PL Poland EMMA Geocode - -
PT Portugal EMMA Geocode - -
RO Romania NUTS Geocode Alias
RS Serbia EMMA Geocode - -
SE Sweden EMMA Polygon - -
SI Slovenia EMMA Polygon - -
SK Slovakia EMMA Geocode - -
UK United-kingdom EMMA Geocode - -

List of known problems and enhancements:

  1. Discuss / decide to move list of “lat-lon” areas to easyweather
    → pro no user settings in the main meteoalarm script
    → con how many areas needed for the largest users
    → con most users only need 1 area

  2. Enhance
    The final release will contain an adapted PWS_easyweathersetup.php script to use a file with all “center-points” for all current EMMA-ID’s.
    That file is generated by @ktrue using the meteoalarm gecodes.json file.
    That way the pwsWD 2012_lts users only need to open easyweather, press save and for each of their alarm-areas (on the Data-tab) the correct lat-lon values are entered.
    That plural of “value” is no typo, some geocode areas have multiple polygons, sometimes 2 or 3, but a few have more. I quote Ken again:

  1. To be solved
    → Some countries are still using NUTS2 as a geocode. F.i. Belgium. I will have to check which area-codes are used and if they are contained in the meteoalarm geocodes.json file. I will add the NUTS2 and "old EMMA-ID to the @ktrue list.
    Anyone can check how recently the codes were used at “Warning-areas found in meteoalrm “all-warnings” feed”

UK315 is Shetland - Wikipedia

Individual islands? :wink:

Sadly my test-servers have a max-memory of 128MB.
The https://feeds.meteoalarm.org/api/v1/warnings/feeds-switzerland file-size has today (2023-12-01) grown to 47.1MB.

My scripts now return a Message
Allowed memory size of 134217728 bytes exhausted (tried to allocate 8192 bytes) in the json_decode instruction of that far to big file with 1151 warnings.
In a few days the file-size has grown from 33MB to 47MB.

I will further test without CHxxx area codes.


Today I feel like Don Quixote
Maybe not fighting windmills, but against the technical staff of a Swiss company behind MeteoAlarm.org

Wim

They’ll probably notice one of a couple of things:

  1. Their usage stats will start to show a decline when people give up trying to download juge files
  2. Their bandwidth usage will massively increase due to the large files that everyone has to download.

I tried to tell them that - well, I said it was a massive waste of their resources! - and they just said it’s entirely up to the participating members. And “If you have any concerns related to a specific country or warning, I kindly suggest that you get in touch with the Alerting Authority, MeteoSwiss, in [this] case.”

You can see the computed center points on a preliminary map at
https://saratoga-weather.org/meteoalarm-map/meteoalarm-map-test.php

I’m still working on refining the calcs/computation for center/middle points of oddly shaped polygons, but the simple algorithm I’m using shows good results for the majority of the areas.

2 Likes

I have to say I thought that polygons would change shape and size from day to day depending on the warning, in line with the MeteoAlarm e-mail I quoted elsewhere: Active METEOALARMS of my region will not be shown - #10 by bitsostring

So, for example, one day’s polygon may be subsumed into a bigger one tomorrow?

Otherwise, are they not just geocodes without a code number?

I don’t have any authoritative knowledge of how the US NWS does the forecasts for severe weather polygons, but I’m assuming that a human forecaster will ‘draw’ on an app and thereby create the polygon (for severe weather/tornado maybe) and use ‘canned’ polygons from shapefiles for flood warnings, For general weather alerts, it’s usually done with Zones (like EMMA_IDs) as part of the alert, and each Zone has a fixed polygon described in shapefiles (which are published by the NWS GIS office GIS),

If the international forecasters are just drawing lines on a map (using an application) to publish the alert, then today’s and tomorrow’s polygon could be different. Seems to me to be simpler for them to pick polygons from a map list than to draw a specific one (unless it is for a very localized weather phenomenon ).

And even simpler to pick a geocode or two - assuming the geocode areas are small enough for the detail required?

I complained bitterly that UK Met Office used to use large area geocodes - 17 to cover the whole UK - especially since “mine” covered SW Scotland, Lothian & Borders, so I have to say I was delighted when they came up with 153 recently. . .

P.S. Sorry about UK315 :smile:

No worries about UK315 … the polygons resulted in a center that’s in the largest island, so ok…

I’m trying to add a selector to add a geojson layer to my map that fetches the alert polygons and displays them so we can see what is happening for those countries that alert by polygon only.
I’m waiting to revise my get-meteoalarm-warning-inc.php script until Wim settles on a version for PWSdashboard since my script is largely based on his work (stolen with permission :slight_smile: )

That’s really what I meant in my comment above:

I was puzzled how you could compute/map the centre points as a one-off exercise :slightly_smiling_face:

That is why they want to sent the polygons with every warning.
So there is no fixed polygon for UKnnn in the meteoalarm.org data-base anymore.

The only way is to “pray” that the countries will use mostly the “old” polygon.

The dashboard scripts will (already do) use the lat/lon of the station, albeit there is a setting to use the centerpoint.

All other extra areas will be using Ken’s centerpoint from the file he supplied.

So in the end we will probably catch the warnings for our own station.
And often also the warnings for neighbouring areas.

But we will miss some.
The old list of three adjacent areas f.i. BE00x,BE00y, NL00z will not have adjacent polygons and the centerpoints from the file can often be outside a smaller nearby area warning.

The “full-page” website templates could have a “local-area” map with all close-by warnings. There is enough room on the startpage.

But a dashboard type template only shows a dozen or more small blocks.
The map should be in a pop-up similar to the current text-only pop-up.

The problem remains, how do we know that there is a warning in our and adjacent areas.


Currently coding the translations from NUTS and FIPS to EMMA_ID
A few days testing and will add the next beta Monday.


Another feature we loose:
In the past when giving a list of areas, the scripts could show one warning for all areas with the same warning.
F.i. Snow BE001, BE13, BE14
That is not possible as from now every warning for every area has a unique key.
And seems to contain only 1 area plus a description in every language for that country.

Wim

Currently still using the new (October 2023) EMMA_ID geocodes:

 "area": [
                            {
                                "areaDesc": "Aberdeen",
                                "geocode": [
                                    {
                                        "value": "UK201",
                                        "valueName": "EMMA_ID"
                                    }
                                ]
                            },

https://feeds.meteoalarm.org/api/v1/warnings/feeds-united-kingdom

I updated a previous post with the list of countries and yes the UK is still on geocodes and it does not need aliases as it is using official EMMA-ID’s

Info links and list of countries

Here’s a handy/current list of aliases in PHP
meteoalarm-geocode-aliases.zip (3.2 KB)

1 Like

Thanks, very usable.

But I am running in a “chicken-egg” problem.
I can only test the alias-code if

  1. there are polygon-countries
    → which need the aliases array
  2. and when there are weather warnings
    → for those EMMA_ID areas.

Just hope Switzerland will show some warnings as today it is a white no-warnings country

Wim

And we still get one warning for all affected areas of interest:

Yes, UK is doing it the efficient way.
One “record” has the alert data, has all area-geocodes for that alert, and the description in (just) 1 language.


Sadly the swiss example of how not to do it.
A warning has one area only and one polygon for every language.
wrnWarningEU-CAP2.php (line 164)
→ switzerland json =31.259.728 characters
→ array_size=66.957.912 time used: 0.4357 seconds

wrnWarningEU-CAP2.php (line 249)
Checked if alerts available for CH_warning-areas: time used: 15.3636 seconds

wrnWarningEU-CAP2.php (250) warnings: 797 in the file
→ alert_plgn: 3675
→ checked polygons: 3675 797 alerts * 5 languages
→ used areas/language: 0


Belgium has
Has 1 separate alert for each affected geocode-area and the for every language the description


I will adept the script and assume that all languages will have the same polygon.
The CAP designers should move the polygon one level up in the CAP

If a geocode is available, the same number of alerts would use less than 0.1 second
As is proved with UK and other countries.

Wim