public SolradNwpForecast GetNearestForecasts(int latitude, int longitude)
        {
            using var dbContext = new SolarRadiationDataContext().WithEnabledDebugging(); // print generated SQL to Debug output

            var locator = new GeoLocator(dbContext);

            return(locator.FindNearestLocation(latitude, longitude)?.ToSolradNwpForecast());
        }
Beispiel #2
0
        static void Main(string[] args)
        {
            var dataDirectory   = new DirectoryInfo("Data");
            var allPropertyData = dataDirectory.CollectSiteChunkDataFromDirectory(
                SolradForecastChunkParser.DailyDataActions.Keys.ToList(), "aust");
            var chunkParser = new SolradForecastChunkParser();

            var parsedForecastData = chunkParser.PopulatePointsDaily <SolradNwpForecast>
                                         (allPropertyData, Console.WriteLine);

            // Do stuff with data..

            using var dbContext = new SolarRadiationDataContext()
                                  .WithHost("localhost")
                                  .WithDatabase("SolarRadiationStore")
                                  .WithUser("admin")
                                  .WithPassword("Password1?")
                                  //.WithEnabledDebugging()
            ;

            new ForecastIngestor().IngestAll(dbContext, parsedForecastData, LogError, 1, true);
        }