From de28446c0dce2a5fb5a569cc3b2dd704bf20d38e Mon Sep 17 00:00:00 2001 From: Philip Schell Date: Wed, 28 Aug 2019 13:11:05 +0200 Subject: [PATCH] bf --- Lora-Map/Model/WeatherWarnings.cs | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/Lora-Map/Model/WeatherWarnings.cs b/Lora-Map/Model/WeatherWarnings.cs index 7050318..7620277 100644 --- a/Lora-Map/Model/WeatherWarnings.cs +++ b/Lora-Map/Model/WeatherWarnings.cs @@ -28,14 +28,16 @@ namespace Fraunhofer.Fit.IoT.LoraMap.Model { while(true) { List ret = new List(); foreach(Int32 item in this.settings.GetWeatherCellIds()) { - JsonData json = this.webrequests.GetJson("https://maps.dwd.de/geoserver/wfs?SERVICE=WFS&VERSION=2.0.0&REQUEST=GetFeature&typeName=dwd:Warnungen_Gemeinden&outputFormat=application/json&cql_filter=WARNCELLID=" + item); - if(json.ContainsKey("features") && json["features"].IsArray && json["features"].Count > 0) { - foreach(JsonData warning in json["features"]) { - try { - ret.Add(new Warning(warning)); - } catch { } + try { + JsonData json = this.webrequests.GetJson("https://maps.dwd.de/geoserver/wfs?SERVICE=WFS&VERSION=2.0.0&REQUEST=GetFeature&typeName=dwd:Warnungen_Gemeinden&outputFormat=application/json&cql_filter=WARNCELLID=" + item); + if (json.ContainsKey("features") && json["features"].IsArray && json["features"].Count > 0) { + foreach (JsonData warning in json["features"]) { + try { + ret.Add(new Warning(warning)); + } catch { } + } } - } + } catch { } } this.Warnungen = ret; Thread.Sleep(60 * 1000);