fridlmue / harbour-avarisk

SailfishOS Client for EAWS Avalanche Bulletins
GNU General Public License v3.0
5 stars 2 forks source link

Add Region: Swiss (no API) #10

Closed fridlmue closed 3 years ago

fridlmue commented 3 years ago

There is no open API at the Moment.

berndhahnebach commented 3 years ago

which site on internet do you need a API for?

fridlmue commented 3 years ago

For the information that is provided on this page: https://www.slf.ch/en/avalanche-bulletin-and-snow-situation.html#avalanchedanger or the information that is queried by the SLFs "White Risk" App. It could be for example JSON API where the reports are provided. Easiest, however, would be a "CAAML" XML file like provided by the Austrian avalanche warning services (e. g. https://api.avalanche.report/albina/api/bulletins, following the standards of http://caaml.org/Schemas/V5.0/Profiles/BulletinEAWS/)

For the Implementation of the yet done Regions it was also useful to get a mapping of used "Region IDs" to the actual Region Names. But if this is needed depends on the API.

simon04 commented 3 years ago

The White Risk app seems to use the following:

fridlmue commented 3 years ago

I'll have a look on that! Thanks for getting that from the APK! Seems, as you found most of the resources... https://www.slf.ch/avalanche/

There seems not to be the concept of the "micro regions" in CH, but it should be possible, to build a SwissDangerPage.qml representing the content and the structure similar to "all over Switzerland" pdf (https://www.slf.ch/avalanche/bulletin/de/gk_bw_de_complete.pdf)

fridlmue commented 3 years ago

Ok, i guessed wrong. There are regions and a mapping: https://www.slf.ch/avalanche/bulletin/de/gk_region2pdf.txt

On this page there is a mapping from the sub regions to the reports: https://www.slf.ch/avalanche/bulletin/de/print_de.ctrl

fridlmue commented 3 years ago

This seems to be the Mapping for the macro regions. With https://www.slf.ch/avalanche/bulletin/de/gk_region2pdf.txt it is possible to get the "id" of the report then. Can s. o. guess, if the first two of the four digit numbers are a Canton mapping? And if it is grouped over Canton-Boundaries (which it looks like): Is there a sub-Grouping that could make some sense? Probably like grouped by the "Sub-Bulletins" (BEA, ENG, JUR, NB, OAN, OW, TES, UWW, ZAN)?

1111; Waadtländer Voralpen
1112; Pays d'Enhaut
1113; Aigle-Leysin
1114; Bex-Villars
1121; Jaun
1122; Gruyère
1211; westliche Berner Voralpen
1212; östliche Berner Voralpen
1213; Hohgant
1221; Niedersimmental
1222; Gstaad
1223; Wildhorn
1224; Lenk
1225; Iffigen
1226; Adelboden
1227; Engstligen
1228; Obersimmental
1231; Kandersteg
1232; Blüemlisalp
1233; Lauterbrunnen
1234; Jungfrau - Schilthorn
1241; Brienz-Interlaken
1242; Grindelwald
1243; Schreckhorn
1244; Hasliberg - Rosenlaui
1245; Guttannen
1246; Gadmertal
1247; Grimselpass
1311; Vouvry
1312; Monthey-Val d'Illiez
2111; Pilatus
2112; Schwarzenberg
2121; Glaubenberg
2122; Engelberg
2123; Melchtal
2124; Gersau
2131; Rothenthurm
2132; Ybrig
2133; Stoos
2134; Bisistal
2211; Schächental
2212; Uri Rot Stock
2221; Meiental
2222; Maderanertal
2223; nördliches Urseren
2224; südliches Urseren
3111; Glarus Nord
3112; Glarus Süd-Grosstal
3113; Glarus Süd-Sernftal
3114; Glarus Mitte
3211; Appenzeller Alpen
3221; Toggenburg
3222; Alpstein - Alvier
3223; Flumserberg
3224; Sarganserland
3311; Liechtenstein
4111; Emosson
4112; Génépi
4113; Val d'Entremont-Val Ferret
4114; Conthey-Fully
4115; Martigny-Verbier
4116; Haut Val de Bagnes
4121; Montana
4122; Val d'Hérens
4123; Arolla
4124; Val d'Anniviers
4125; Mountet
4211; Leukerbad - Lötschental
4212; Turtmanntal
4213; Konkordia Gebiet
4214; Riederalp
4215; Leuk
4221; untere Vispertäler
4222; Zermatt
4223; Saas Fee
4224; Monte Rosa
4225; Mattmark
4231; nördliches Simplon Gebiet
4232; südliches Simplon Gebiet
4241; Reckingen
4242; Binntal
4243; nördliches Obergoms
4244; südliches Obergoms
5111; nördliches Prättigau
5112; südliches Prättigau
5113; westliche Silvretta
5121; Calanda
5122; Schanfigg
5123; Davos
5124; Flims
5211; nördliches Tujetsch
5212; südliches Tujetsch
5214; Obersaxen - Safiental
5215; Val Sumvitg
5216; Zervreila
5221; Domleschg - Lenzerheide
5222; Schams
5223; Rheinwald
5231; Albulatal
5232; Savognin
5233; Avers
5234; Bivio
6111; Bedrettotal
6112; obere Leventina
6113; Bleniotal
6114; obere Maggiatäler
6115; untere Leventina
6121; untere Maggiatäler
6122; Riviera
6131; Luganese
6132; Mendrisiotto
6211; alto Moesano
6212; basso Moesano
7111; Corvatsch
7112; Bernina
7113; Zuoz
7114; St. Moritz
7115; Val Chamuera
7121; Samnaun
7122; östliche Silvretta
7123; Sur Tasna
7124; Val Suot
7125; Val dal Spöl
7126; Val S-charl
7211; Bergell
7221; oberes Puschlav
7222; unteres Puschlav
7231; Münstertal
8111; Saint-Cergue
8112; Vallée de Joux
8113; Yverdon - Bevaix
8114; Val de Travers
8211; Val de Ruz - Colombier
8212; Bienne - Neuâchtel
8213; Vallon de Saint-Imier
8214; Moutier - Tavannes
8215; Thal
8216; Olten-Gösgen
8221; La Chaux-de-Fonds - Le Locle
8222; Franches-Montagnes
8223; Ajoie
8224; Delémont - Bellelay
8225; Laufental
8226; Basel
8227; Oberes Baselbiet
8228; Rheinfelden
9111; westliches Mittelland
9211; zentrales Mittelland
9311; östliches Mittelland
fridlmue commented 3 years ago

Ok, it is still very "rough", but It should be feasable to get the swiss apps running like that. Unfortunately it will need a own DataType, as the information structure is different. When I figured out, how to sort the regions in a nice way, it can land in the App.

photo_2021-01-10_19-10-38 photo_2021-01-10_19-10-35 photo_2021-01-10_19-10-42 photo_2021-01-10_19-10-45

fridlmue commented 3 years ago

Will be in 0.7 in a first Stage.

fridlmue commented 3 years ago

Can be tested here