Beispiel #1
0
        public void get_all_temperature_for_a_position_a_given_day()
        {
            var service = new SmhiService();
            var result  = service.GetMeterologicalForecast(13.846M, 58.390M).Result;

            List <TimeTemp> timetemps = service.FilterTemperature(result, DateTime.Now);
        }
Beispiel #2
0
        public void get_temperature_for_first_timeserie_better()
        {
            var service = new SmhiService();
            var result  = service.GetMeterologicalForecast(13.846M, 58.390M).Result;

            DateTime  time        = result.timeSeries[0].validTime;
            Parameter param       = result.timeSeries[0].parameters.Single(p => p.name == "t");
            decimal   temperature = param.values[0];
        }
Beispiel #3
0
        public void Get_SMHI_In_Classes()
        {
            decimal longitude = 16.158m;
            decimal latitude  = 58.5812m;

            SmhiService service = new SmhiService();
            Rootobject  x       = service.GetMeterologicalForecast(longitude, latitude).Result;

            Timesery firstTimeSeries = x.timeSeries[0];

            DateTime time      = x.timeSeries[0].validTime;                // klockslag
            decimal  value     = x.timeSeries[0].parameters[11].values[0]; //värde(temperatur) (om temperaturen fortfarande är på position 11)
            string   paramname = x.timeSeries[0].parameters[11].name;      // namn ("t")
        }