Exemple #1
0
        static void GetVariousDataFromApi()
        {
            var st    = new[] { 50300, 50310 };
            var ds    = new MetDataService();
            var types = ds.getTimeserieTypesProperties("", "");

            var timeseriesTypeObs   = "T_ELEM_OBS";
            var timeseriesTypeObsId = "2";

            var stations = ds
                           .getStationsFromTimeserieType("2", "")
                           .Where(s => st.Any(x => x == s.stnr))
                           .OrderBy(x => x.name)
                           .ToArray();

            foreach (var s in stations)
            {
                Console.WriteLine($"{s.name} {s.fromYear}-{s.toYear} {s.stnr}");
            }

            Console.WriteLine();

            var parameters = ds
                             .getElementsFromTimeserieType(timeseriesTypeObsId)
                             .Where(x => x.description.ToLower().Contains("snø")) //snow
                             .ToArray();

            foreach (var p in parameters)
            {
                Console.WriteLine($"{p.name} {p.elemNo}");
            }

            Console.ReadLine();
        }
Exemple #2
0
        public object GetSeriesType(string lang = defaultLanguage)
        {
            var ds = new MetDataService();

            return(ds.getTimeserieTypesProperties(lang, "").Select(x => new
            {
                x.serieTypeID,
                x.serieTypeName,
                x.serieTypeDescription
            }).ToArray());
        }