Ejemplo n.º 1
0
        public ActionResult TestIDW(DateTime time)
        {
            IDW     idw;
            Kriging kriging;

            using (DataCenterServiceClient client = new DataCenterServiceClient())
            {
                StationHourData[] data = client.GetStationHourDataListFromHistoryByTime("GDAEIB", "2019!@GD", time);
                data = data.Where(o => o.AQI != "—").ToArray();
                double[] X = new double[data.Length], Y = new double[data.Length], T = new double[data.Length];
                for (int i = 0; i < data.Length; i++)
                {
                    StationHourData item = data[i];
                    double          x = double.Parse(item.Longitude), y = double.Parse(item.Latitude);
                    double          t = double.Parse(item.AQI);
                    X[i] = x;
                    Y[i] = y;
                    T[i] = t;
                }
                idw     = new IDW(X, Y, T);
                kriging = new Kriging(X, Y, T);
            }
            double temp = idw.Predict(112, 36);

            kriging.Train(KrigingModel.Exponential, 0, 100);
            temp = kriging.Predict(112, 36);
            return(Content(temp.ToString()));
        }
Ejemplo n.º 2
0
        public static void DrawGridByIDW(double[] t, double[] x, double[] y, double[] extent, double resolution, string fileName)
        {
            IDW predict = new IDW(x, y, t);

            DrawGrid(extent, resolution, predict, fileName);
        }
Ejemplo n.º 3
0
        private void iDW插值ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            IDW idw = new IDW();

            idw.Show();
        }