public frmRunRegressionRaster(IMap map)
 {
     InitializeComponent();
     mp = map;
     if (mp != null)
     {
         vUtil = new viewUtility((IActiveView)mp);
     }
     populateComboBox();
     rstUtil = new rasterUtil();
     rR = new regressionRaster(ref rstUtil);
 }
Beispiel #2
0
 public frmRunRegressionRaster(IMap map)
 {
     InitializeComponent();
     mp = map;
     if (mp != null)
     {
         vUtil = new viewUtility((IActiveView)mp);
     }
     populateComboBox();
     rstUtil = new rasterUtil();
     rR      = new regressionRaster(ref rstUtil);
 }
Beispiel #3
0
        private void btnExecute_Click(object sender, EventArgs e)
        {
            string smpFtrNm = cmbSampleFeatureClass.Text;

            int    ent  = System.Convert.ToInt32(nudEnter.Value);
            int    sty  = System.Convert.ToInt32(nudStay.Value);
            string wght = cmbWeight.Text;

            if (wght != null && wght != "")
            {
                WEIGHT = wght;
            }
            bool rslt       = chbResults.Checked;
            bool val        = chbValidate.Checked;
            bool edSas      = chbSas.Checked;
            bool stepSelect = chbStepWise.Checked;

            if (smpFtrNm == null || smpFtrNm == "")
            {
                MessageBox.Show("You must select a feature Class", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }
            if (lstDependent.Items.Count < 1)
            {
                MessageBox.Show("You must select at least 1 dependent field", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }
            if (lstDependent.Items.Count > 1)
            {
                stepSelect = false;
            }
            List <string> lstDep = new List <string>();

            for (int i = 0; i < lstDependent.Items.Count; i++)
            {
                string s = lstDependent.Items[i].ToString();
                lstDep.Add(s);
            }
            List <string> lstInd = new List <string>();

            for (int i = 0; i < lstIndependent.Items.Count; i++)
            {
                string s = lstIndependent.Items[i].ToString();
                lstInd.Add(s);
            }
            if (lstInd.Count < 1)
            {
                MessageBox.Show("You must select at least one independent field", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }
            this.Visible = false;
            IFeatureClass    ftrCls = ftrDic[smpFtrNm];
            regressionRaster rR     = new regressionRaster();

            rR.Dependentfield    = String.Join(" ", lstDep.ToArray());
            rR.IndependentFields = lstInd.ToArray();
            rR.OutWorkspace      = ((IDataset)ftrCls).Workspace;
            rR.SampleLocations   = ftrCls;
            rR.StepWiseSelection = stepSelect;
            rR.Validate          = val;
            rR.WeightField       = WEIGHT;
            rR.SlEnter           = ent;
            rR.SlStay            = sty;
            rR.runSasProcedure();
            if (rslt == true)
            {
                rR.showModelOutput();
            }
            if (edSas == true)
            {
                rR.editSasFile();
            }
            this.Close();
        }