예제 #1
0
        private void btnExecute_Click(object sender, EventArgs e)
        {
            string projectFtrName = cmbProjectBoundary.Text;
            string MapStr         = cmbMap.Text;
            double alpha          = System.Convert.ToDouble(nudAlpha.Value);
            string oPath          = txtOAA.Text;
            string aPath          = txtOutModel.Text;

            if (aPath == null || aPath == "")
            {
                MessageBox.Show("You must select an accuracy assessment  model", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }
            if (oPath == null || oPath == "")
            {
                MessageBox.Show("You must select an output model", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }

            if (projectFtrName == null || projectFtrName == "")
            {
                MessageBox.Show("You must select a feature Class that represent a boundary", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }
            if (MapStr == null || MapStr == "")
            {
                MessageBox.Show("You must select a Map featureClass or Raster", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }


            this.Visible = false;
            IFeatureClass pj = ftrDic[projectFtrName];

            Statistics.dataPrepAdjustAccuracyAssessment aa = null;
            if (ftrDic.ContainsKey(MapStr))
            {
                IFeatureClass mp = ftrDic[MapStr];
                aa = new Statistics.dataPrepAdjustAccuracyAssessment(pj, mp, oPath, aPath);
            }
            else
            {
                IRaster mp = rstDic[MapStr];
                aa = new Statistics.dataPrepAdjustAccuracyAssessment(pj, mp, oPath, aPath);
            }
            aa.buildModel();
            Statistics.ModelHelper mH = new Statistics.ModelHelper(aPath);
            mH.openModelReport(aPath, alpha);
            this.Close();
        }
예제 #2
0
        private void btnExecute_Click(object sender, EventArgs e)
        {
            string rstNm  = cmbSampleFeatureClass.Text;
            string mdPath = txtOutputPath.Text;

            if (rstNm == null || rstNm == "")
            {
                MessageBox.Show("You must specify a output name", "No Output", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }
            if (mdPath == null || mdPath == "")
            {
                MessageBox.Show("You must specify a model path", "No Output", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }
            ITable tbl = rstDic[rstNm];

            this.Visible = false;
            esriUtil.Forms.RunningProcess.frmRunningProcessDialog rp = new RunningProcess.frmRunningProcessDialog(false);
            DateTime dt = DateTime.Now;

            rp.addMessage("Predicting new data. This may take a while...");
            rp.stepPGBar(10);
            rp.TopMost = true;
            rp.Show();
            try
            {
                Statistics.ModelHelper.runProgressBar("Predicting data");
                Statistics.ModelHelper br = new Statistics.ModelHelper(mdPath);
                rp.Refresh();
                br.predictNewData(tbl, qf);
                this.DialogResult = DialogResult.OK;
            }
            catch (Exception ex)
            {
                rp.addMessage(ex.ToString());
            }
            finally
            {
                Statistics.ModelHelper.closeProgressBar();
                DateTime dt2 = DateTime.Now;
                TimeSpan ts  = dt2.Subtract(dt);
                string   t   = " in " + ts.Days.ToString() + " days " + ts.Hours.ToString() + " hours " + ts.Minutes.ToString() + " minutes and " + ts.Seconds.ToString() + " seconds .";
                rp.stepPGBar(100);
                rp.addMessage("Finished calculations" + t);
                rp.enableClose();
                this.Close();
            }
        }
예제 #3
0
        private void btnVariables_Click(object sender, EventArgs e)
        {
            string mPath = txtOutputPath.Text;

            Statistics.ModelHelper mh = new Statistics.ModelHelper(mPath);
            mh.openModelReport(mPath, 0.05, false);
            Forms.RunningProcess.frmRunningProcessDialog rp = new RunningProcess.frmRunningProcessDialog(false);
            rp.stepPGBar(100);
            rp.Text = "Model Variables";
            rp.enableClose();
            rp.addMessage("Independent variable names:");
            foreach (string s in mh.IndependentVariables)
            {
                rp.addMessage(s);
            }
            rp.Show();
        }
 private void btnExecute_Click(object sender, EventArgs e)
 {
     string rstNm = cmbSampleFeatureClass.Text;
     string mdPath = txtOutputPath.Text;
     if (rstNm == null || rstNm == "")
     {
         MessageBox.Show("You must specify a output name","No Output",MessageBoxButtons.OK,MessageBoxIcon.Error);
         return;
     }
     if (mdPath == null || mdPath == "")
     {
         MessageBox.Show("You must specify a model path","No Output",MessageBoxButtons.OK,MessageBoxIcon.Error);
         return;
     }
     ITable tbl = rstDic[rstNm];
     this.Visible = false;
     esriUtil.Forms.RunningProcess.frmRunningProcessDialog rp = new RunningProcess.frmRunningProcessDialog(false);
     DateTime dt = DateTime.Now;
     rp.addMessage("Predicting new data. This may take a while...");
     rp.stepPGBar(10);
     rp.TopMost = true;
     rp.Show();
     try
     {
         Statistics.ModelHelper.runProgressBar("Predicting data");
         Statistics.ModelHelper br = new Statistics.ModelHelper(mdPath);
         rp.Refresh();
         br.predictNewData(tbl,qf);
         this.DialogResult = DialogResult.OK;
     }
     catch (Exception ex)
     {
         rp.addMessage(ex.ToString());
     }
     finally
     {
         Statistics.ModelHelper.closeProgressBar();
         DateTime dt2 = DateTime.Now;
         TimeSpan ts = dt2.Subtract(dt);
         string t = " in " + ts.Days.ToString() + " days " + ts.Hours.ToString() + " hours " + ts.Minutes.ToString() + " minutes and " + ts.Seconds.ToString() + " seconds .";
         rp.stepPGBar(100);
         rp.addMessage("Finished calculations" + t);
         rp.enableClose();
         this.Close();
     }
 }
예제 #5
0
        private void btnExecute_Click(object sender, EventArgs e)
        {
            string rstNm  = txtOutNm.Text;
            string mdPath = txtOutputPath.Text;

            if (rstNm == null || rstNm == "")
            {
                MessageBox.Show("You must specify a output name", "No Output", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }
            if (mdPath == null || mdPath == "")
            {
                MessageBox.Show("You must specify a model path", "No Output", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }
            if (lsbRaster.Items.Count < 1)
            {
                MessageBox.Show("You must select at least on Raster", "No Rasters", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }
            IRasterBandCollection rsBc = new RasterClass();

            for (int i = 0; i < lsbRaster.Items.Count; i++)
            {
                rsBc.AppendBands((IRasterBandCollection)rstDic[lsbRaster.Items[i].ToString()]);
            }
            IFunctionRasterDataset frDset = rsUtil.compositeBandFunction(rsBc);

            this.Visible = false;
            esriUtil.Forms.RunningProcess.frmRunningProcessDialog rp = new RunningProcess.frmRunningProcessDialog(false);
            DateTime dt = DateTime.Now;

            rp.addMessage("Building Model Raster. This may take a while...");
            rp.stepPGBar(10);
            rp.TopMost = true;
            rp.Show();
            try
            {
                Statistics.ModelHelper br = new Statistics.ModelHelper(mdPath, rsUtil.createRaster(frDset), rsUtil);
                outraster = br.getRaster();
                if (mp != null && addToMap)
                {
                    rp.Show();
                    rp.Refresh();
                    IRasterLayer rstLyr = new RasterLayerClass();
                    rstLyr.CreateFromRaster(outraster);
                    rstLyr.Name    = rstNm;
                    rstLyr.Visible = false;
                    mp.AddLayer(rstLyr);
                }
                outrastername     = rstNm;
                this.DialogResult = DialogResult.OK;
            }
            catch (Exception ex)
            {
                rp.addMessage(ex.ToString());
            }
            finally
            {
                DateTime dt2 = DateTime.Now;
                TimeSpan ts  = dt2.Subtract(dt);
                string   t   = " in " + ts.Days.ToString() + " days " + ts.Hours.ToString() + " hours " + ts.Minutes.ToString() + " minutes and " + ts.Seconds.ToString() + " seconds .";
                rp.stepPGBar(100);
                rp.addMessage("Finished Building Raster" + t);
                rp.enableClose();
                this.Close();
            }
        }
 private void btnVariables_Click(object sender, EventArgs e)
 {
     string mPath = txtOutputPath.Text;
     Statistics.ModelHelper mh = new Statistics.ModelHelper(mPath);
     mh.openModelReport(mPath, 0.05, false);
     Forms.RunningProcess.frmRunningProcessDialog rp = new RunningProcess.frmRunningProcessDialog(false);
     rp.stepPGBar(100);
     rp.Text = "Model Variables";
     rp.enableClose();
     rp.addMessage("Independent variable names:");
     foreach (string s in mh.IndependentVariables)
     {
         rp.addMessage(s);
     }
     rp.Show();
 }
 private void btnExecute_Click(object sender, EventArgs e)
 {
     string rstNm = txtOutNm.Text;
     string mdPath = txtOutputPath.Text;
     if (rstNm == null || rstNm == "")
     {
         MessageBox.Show("You must specify a output name","No Output",MessageBoxButtons.OK,MessageBoxIcon.Error);
         return;
     }
     if (mdPath == null || mdPath == "")
     {
         MessageBox.Show("You must specify a model path","No Output",MessageBoxButtons.OK,MessageBoxIcon.Error);
         return;
     }
     if (lsbRaster.Items.Count < 1)
     {
         MessageBox.Show("You must select at least on Raster", "No Rasters", MessageBoxButtons.OK, MessageBoxIcon.Error);
         return;
     }
     IRasterBandCollection rsBc = new RasterClass();
     for (int i = 0; i < lsbRaster.Items.Count; i++)
     {
         rsBc.AppendBands((IRasterBandCollection)rstDic[lsbRaster.Items[i].ToString()]);
     }
     IFunctionRasterDataset frDset = rsUtil.compositeBandFunction(rsBc);
     this.Visible = false;
     esriUtil.Forms.RunningProcess.frmRunningProcessDialog rp = new RunningProcess.frmRunningProcessDialog(false);
     DateTime dt = DateTime.Now;
     rp.addMessage("Building Model Raster. This may take a while...");
     rp.stepPGBar(10);
     rp.TopMost = true;
     rp.Show();
     try
     {
         Statistics.ModelHelper br = new Statistics.ModelHelper(mdPath, rsUtil.createRaster(frDset),rsUtil);
         outraster = br.getRaster();
         if (mp != null&&addToMap)
         {
             rp.Show();
             rp.Refresh();
             IRasterLayer rstLyr = new RasterLayerClass();
             rstLyr.CreateFromRaster(outraster);
             rstLyr.Name = rstNm;
             rstLyr.Visible = false;
             mp.AddLayer(rstLyr);
         }
         outrastername = rstNm;
         this.DialogResult = DialogResult.OK;
     }
     catch (Exception ex)
     {
         rp.addMessage(ex.ToString());
     }
     finally
     {
         DateTime dt2 = DateTime.Now;
         TimeSpan ts = dt2.Subtract(dt);
         string t = " in " + ts.Days.ToString() + " days " + ts.Hours.ToString() + " hours " + ts.Minutes.ToString() + " minutes and " + ts.Seconds.ToString() + " seconds .";
         rp.stepPGBar(100);
         rp.addMessage("Finished Building Raster" + t);
         rp.enableClose();
         this.Close();
     }
 }
 private ITable predictNewValues(string[] paramArr)
 {
     string tblStr = paramArr[0];
     ITable tbl = getTable(tblStr);
     string mPath = getModelPath(paramArr[1]);
     IQueryFilter qf = new QueryFilterClass();
     if (paramArr.Length > 2)
     {
         qf.WhereClause = paramArr[2];
     }
     Statistics.ModelHelper mH = new Statistics.ModelHelper(mPath);
     mH.predictNewData(tbl,qf);
     return tbl;
 }
 private IFunctionRasterDataset createModelFunction(string[] paramArr)
 {
     IRasterBandCollection rsBC = new RasterClass();
     string rstStr = paramArr[0];
     string mPath = getModelPath(paramArr[1]);
     foreach (string s in rstStr.Split(new char[]{','}))
     {
         IFunctionRasterDataset rs = getRaster(s);
         rsBC.AppendBands((IRasterBandCollection)rs);
     }
     IFunctionRasterDataset fDset = rsUtil.compositeBandFunction(rsBC);
     Statistics.ModelHelper mH = new Statistics.ModelHelper(mPath, rsUtil.createRaster(fDset), rsUtil);
     return rsUtil.createIdentityRaster(mH.getRaster());
 }
        private void btnExecute_Click(object sender, EventArgs e)
        {
            string projectFtrName = cmbProjectBoundary.Text;
            string MapStr = cmbMap.Text;
            double alpha = System.Convert.ToDouble(nudAlpha.Value);
            string oPath = txtOAA.Text;
            string aPath = txtOutModel.Text;
            if (aPath == null || aPath == "")
            {
                MessageBox.Show("You must select an accuracy assessment  model", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }
            if (oPath == null || oPath == "")
            {
                MessageBox.Show("You must select an output model", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }

            if (projectFtrName == null || projectFtrName == "")
            {
                MessageBox.Show("You must select a feature Class that represent a boundary", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }
            if (MapStr == null || MapStr == "")
            {
                MessageBox.Show("You must select a Map featureClass or Raster", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }

            this.Visible = false;
            IFeatureClass pj = ftrDic[projectFtrName];
            Statistics.dataPrepAdjustAccuracyAssessment aa = null;
            if (ftrDic.ContainsKey(MapStr))
            {
                IFeatureClass mp = ftrDic[MapStr];
                aa = new Statistics.dataPrepAdjustAccuracyAssessment(pj, mp, oPath, aPath);
            }
            else
            {
                IRaster mp = rstDic[MapStr];
                aa = new Statistics.dataPrepAdjustAccuracyAssessment(pj, mp, oPath, aPath);
            }
            aa.buildModel();
            Statistics.ModelHelper mH = new Statistics.ModelHelper(aPath);
            mH.openModelReport(aPath, alpha);
            this.Close();
        }
        private void btnExecute_Click(object sender, EventArgs e)
        {
            string smpFtrNm = cmbSampleFeatureClass.Text;
            string strataField = cmbStrataField.Text;
            string outP = txtOutputPath.Text;
            if (smpFtrNm == null || smpFtrNm == "")
            {
                MessageBox.Show("You must select a feature Class","Error",MessageBoxButtons.OK,MessageBoxIcon.Error);
                return;
            }
            if (strataField == null || strataField == "")
            {
                MessageBox.Show("You must select a strata field or raster", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }
            if (outP == null || outP == "")
            {
                MessageBox.Show("You must select an output model path", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }
            try
            {
                Statistics.ModelHelper.runProgressBar("Running Stratified VarCov");
                List<string> lstInd = new List<string>();
                for (int i = 0; i < lstIndependent.Items.Count; i++)
                {
                    string s = lstIndependent.Items[i].ToString();
                    lstInd.Add(s);
                }

                Statistics.dataPrepStrata strata = null;
                if (ftrDic.ContainsKey(smpFtrNm))
                {
                    if (lstInd.Count < 1)
                    {
                        MessageBox.Show("You must select at least one variable field", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                        return;
                    }
                    this.Visible = false;
                    ITable ftrCls = ftrDic[smpFtrNm];
                    strata = new Statistics.dataPrepStrata(ftrCls, lstInd.ToArray(), strataField);
                }
                else
                {
                    IRaster rs = rstDic[smpFtrNm];
                    IRaster rs2 = rstDic[strataField];
                    this.Visible = false;
                    strata = new Statistics.dataPrepStrata(rs, rs2);
                }
                strata.writeModel(outP);
                Statistics.ModelHelper mH = new Statistics.ModelHelper(outP);
                mH.openModelReport(outP, 0.05);
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString());
            }
            finally
            {
                Statistics.ModelHelper.closeProgressBar();
                this.Close();
            }
        }
예제 #12
0
        private void btnExecute_Click(object sender, EventArgs e)
        {
            string smpFtrNm    = cmbSampleFeatureClass.Text;
            string strataField = cmbStrataField.Text;
            string outP        = txtOutputPath.Text;

            if (smpFtrNm == null || smpFtrNm == "")
            {
                MessageBox.Show("You must select a feature Class", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }
            if (strataField == null || strataField == "")
            {
                MessageBox.Show("You must select a strata field or raster", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }
            if (outP == null || outP == "")
            {
                MessageBox.Show("You must select an output model path", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }
            try
            {
                Statistics.ModelHelper.runProgressBar("Running Stratified VarCov");
                List <string> lstInd = new List <string>();
                for (int i = 0; i < lstIndependent.Items.Count; i++)
                {
                    string s = lstIndependent.Items[i].ToString();
                    lstInd.Add(s);
                }

                Statistics.dataPrepStrata strata = null;
                if (ftrDic.ContainsKey(smpFtrNm))
                {
                    if (lstInd.Count < 1)
                    {
                        MessageBox.Show("You must select at least one variable field", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                        return;
                    }
                    this.Visible = false;
                    ITable ftrCls = ftrDic[smpFtrNm];
                    strata = new Statistics.dataPrepStrata(ftrCls, lstInd.ToArray(), strataField);
                }
                else
                {
                    IRaster rs  = rstDic[smpFtrNm];
                    IRaster rs2 = rstDic[strataField];
                    this.Visible = false;
                    strata       = new Statistics.dataPrepStrata(rs, rs2);
                }
                strata.writeModel(outP);
                Statistics.ModelHelper mH = new Statistics.ModelHelper(outP);
                mH.openModelReport(outP, 0.05);
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString());
            }
            finally
            {
                Statistics.ModelHelper.closeProgressBar();
                this.Close();
            }
        }