rolfberkenbosch / meteoalert-api

MIT License
12 stars 10 forks source link

Not matching province name when there are specific city names appended #22

Closed prezervos closed 2 years ago

prezervos commented 3 years ago

Hello, could you implement some matching / regexp matching for the province name? In czechia feed https://feeds.meteoalarm.org/feeds/meteoalarm-legacy-atom-czechia you can find more entries with the same province name with additional information in brackets where are the names of specific cities in the province. At least for province "Středočeský kraj" there are more entries with different cities in brackets like in code below. With the possibility to use wildcards, there could be a province name like "Středočeský kraj*Kladno*" which would select a province matching this string.

EMMA_ID CZ009 Středočeský kraj (Brandýs nad Labem-Stará Boleslav, Český Brod, Kladno, Kolín, Kralupy nad Vltavou, Lysá nad Labem, Mělník, Mladá Boleslav, Mnichovo Hradiště, Neratovice, Nymburk, Poděbrady, Rakovník, Slaný) Flood Vigilance 2021-07-08T18:16:46+00:00 2021-07-11T00:30:00+00:00 2021-07-08T18:16:46+00:00 2021-07-08T18:15:31+00:00 Likely Moderate Immediate Public Alert Actual 2.49.0.0.203.0.CZ.210708181646.XOCZ55_OKSC_003425 meteoalarm.org https://meteoalarm.org 2021-07-08T18:16:46Z https://hub.meteoalarm.org/warnings/feeds-czechia/2caa4394-9e51-4ab8-9ba6-20d2b19c2bcc?index_info=1&index_area=0&index_geocode=1 Yellow Rain-flood Warning issued for Czech Republic - Středočeský kraj (Brandýs nad Labem-Stará Boleslav, Český Brod, Kladno, Kolín, Kralupy nad Vltavou, Lysá nad Labem, Mělník, Mladá Boleslav, Mnichovo Hradiště, Neratovice, Nymburk, Poděbrady, Rakovník, Slaný) 2021-07-08T18:16:46Z EMMA_ID CZ009 Středočeský kraj (Beroun, Hořovice, Příbram) Very Strong Thunderstorms 2021-07-08T18:16:46+00:00 2021-07-08T18:29:59+00:00 2021-07-08T18:16:46+00:00 2021-07-08T18:15:31+00:00 Observed Severe Immediate Public Alert Actual 2.49.0.0.203.0.CZ.210708181646.XOCZ55_OKSC_003422 meteoalarm.org https://meteoalarm.org 2021-07-08T18:16:46Z https://hub.meteoalarm.org/warnings/feeds-czechia/e147e920-7569-4636-ad7c-32c2abb8a495?index_info=1&index_area=0&index_geocode=1 Orange Thunderstorm Warning issued for Czech Republic - Středočeský kraj (Beroun, Hořovice, Příbram) 2021-07-08T18:16:46Z
SVH-Powel commented 3 years ago

I agree with this. This is another example. Province is Vestfold and it will not match a warning like this: <cap:areaDesc>Oestfold, Oslo, Akershus, Buskerud and Vestfold</cap:areaDesc> In fact, the province has to be set to "Oestfold, Oslo, Akershus, Buskerud and Vestfold" to match and that is pointless.

Why not use

<cap:geocode>
  <valueName>NUTS3</valueName>
  <value>NO033</value>
</cap:geocode>

instead of areaDesc?

stigvi commented 3 years ago

Here is another example. Oestafjells in not even a province in Norway.

`

NUTS3 NO032 Oestafjells Frequent lightning ` There is no other solution to this than using the cap:geocode field.