Example #1
0
        static void Main(string[] args)
        {
            _dbService = new ControllerDataService(dbConnectionString);
            var interpolater = new CalculateHeatmap();

            Console.WriteLine("Retrieve Yield Report Data id = {0} and Boundary data from Database", 1862);
            YieldReportData yieldData = _dbService.GetYieldReport(649, false, false);
            var             boundary  = _dbService.GetFieldBoundary(yieldData.FieldId);

            //var data = yieldData.YieldData.Yield.data;
            Console.WriteLine("Call GPU interpolation function");
            var raster = interpolater.RunGpuInterpolation(yieldData, boundary);

            interpolater.SaveResults(raster, _dbService, @"C:\AgVerdict\Gpu\GpuRaster.png");
            Console.WriteLine("Saving output to image file");

            Console.WriteLine("Call CPU interpolation function");
            raster = interpolater.RunCpuInterpolation(yieldData, boundary);
            interpolater.SaveResults(raster, _dbService, @"C:\AgVerdict\Gpu\CpuRaster.png");
            Console.WriteLine("Saving output to image file");
            Console.WriteLine("press any key to exit ...");
            Console.ReadKey();
        }
        public void SaveResults(RtRaster <double> raster, IControllerDataService dataService, string name)
        {
            var res = CalculateHeatmap.GeneratePaletteAndHistogramForData(dataService, raster);

            SaveRasterToFile(raster, res.Item1, name);
        }