示例#1
0
        private void getFeaturePath()
        {
            string outPath = null;
            string outName = "";

            ESRI.ArcGIS.CatalogUI.IGxDialog gxDialog = new ESRI.ArcGIS.CatalogUI.GxDialogClass();
            gxDialog.AllowMultiSelect = true;
            ESRI.ArcGIS.Catalog.IGxObjectFilter flt = null;
            flt = new ESRI.ArcGIS.Catalog.GxFilterTablesAndFeatureClassesClass();
            gxDialog.ObjectFilter = flt;
            gxDialog.Title        = "Select a ";
            ESRI.ArcGIS.Catalog.IEnumGxObject eGxObj;
            if (gxDialog.DoModalOpen(0, out eGxObj))
            {
                ESRI.ArcGIS.Catalog.IGxObject gxObj = eGxObj.Next();
                while (gxObj != null)
                {
                    outPath = gxObj.FullName;
                    outName = gxObj.BaseName;
                    ITable rs = geoUtil.getTable(outPath);
                    if (!rstDic.ContainsKey(outName))
                    {
                        rstDic.Add(outName, rs);
                        cmbdataset.Items.Add(outName);
                    }
                    else
                    {
                        rstDic[outName] = rs;
                    }
                    gxObj = eGxObj.Next();
                }
                cmbdataset.SelectedItem = outName;
            }
            return;
        }
示例#2
0
        private void getRasterPath()
        {
            string outPath = null;
            string outName = "";

            ESRI.ArcGIS.CatalogUI.IGxDialog gxDialog = new ESRI.ArcGIS.CatalogUI.GxDialogClass();
            gxDialog.AllowMultiSelect = false;
            ESRI.ArcGIS.Catalog.IGxObjectFilter flt = null;
            flt = new ESRI.ArcGIS.Catalog.GxFilterRasterDatasetsClass();
            gxDialog.ObjectFilter = flt;
            gxDialog.Title        = "Select a Raster Dataset";
            ESRI.ArcGIS.Catalog.IEnumGxObject eGxObj;
            if (gxDialog.DoModalOpen(0, out eGxObj))
            {
                ESRI.ArcGIS.Catalog.IGxObject gxObj = eGxObj.Next();
                while (gxObj != null)
                {
                    outPath = gxObj.FullName;
                    outName = gxObj.BaseName;
                    IRaster rs = rsUtil.returnRaster(outPath);
                    if (!rstDic.ContainsKey(outName))
                    {
                        rstDic.Add(outName, rs);
                        cmbValueRaster.Items.Add(outName);
                    }
                    else
                    {
                        rstDic[outName] = rs;
                    }
                    gxObj = eGxObj.Next();
                }
            }
            cmbValueRaster.SelectedItem = outName;
            return;
        }
示例#3
0
        private void getRasterPath(ComboBox cntr)
        {
            string outPath = null;
            string outName = "";

            ESRI.ArcGIS.CatalogUI.IGxDialog gxDialog = new ESRI.ArcGIS.CatalogUI.GxDialogClass();
            gxDialog.AllowMultiSelect = false;
            ESRI.ArcGIS.Catalog.IGxObjectFilter flt = null;
            flt = new ESRI.ArcGIS.Catalog.GxFilterRasterDatasetsClass();
            gxDialog.ObjectFilter = flt;
            gxDialog.Title        = "Select a Feature";
            ESRI.ArcGIS.Catalog.IEnumGxObject eGxObj;
            if (gxDialog.DoModalOpen(0, out eGxObj))
            {
                ESRI.ArcGIS.Catalog.IGxObject gxObj = eGxObj.Next();
                outPath = gxObj.FullName;
                outName = gxObj.BaseName;
                if (!rstDic.ContainsKey(outName))
                {
                    rstDic.Add(outName, rsUtil.returnRaster(outPath));
                    cntr.Items.Add(outName);
                }
                else
                {
                    rstDic[outName] = rsUtil.returnRaster(outPath);
                }
                cntr.Text = outName;
            }
            return;
        }
示例#4
0
        private void getFeaturePath()
        {
            string outPath = null;
            string outName = "";

            ESRI.ArcGIS.CatalogUI.IGxDialog gxDialog = new ESRI.ArcGIS.CatalogUI.GxDialogClass();
            gxDialog.AllowMultiSelect = true;
            ESRI.ArcGIS.Catalog.IGxObjectFilter flt = null;
            flt = new ESRI.ArcGIS.Catalog.GxFilterRasterDatasetsClass();
            gxDialog.ObjectFilter = flt;
            gxDialog.Title        = "Select a Raster";
            ESRI.ArcGIS.Catalog.IEnumGxObject eGxObj;
            if (gxDialog.DoModalOpen(0, out eGxObj))
            {
                ESRI.ArcGIS.Catalog.IGxObject gxObj = eGxObj.Next();
                while (gxObj != null)
                {
                    outPath = gxObj.FullName;
                    outName = gxObj.BaseName;
                    if (!rstDic.ContainsKey(outName))
                    {
                        rstDic.Add(outName, rsUtil.createIdentityRaster(outPath));
                        //cmbInRaster1.Items.Add(outName);
                        lsbRaster.Items.Add(outName);
                    }
                    else
                    {
                        rstDic[outName] = rsUtil.createIdentityRaster(outPath);
                    }
                    gxObj = eGxObj.Next();
                }
                //cmbInRaster1.SelectedItem = outName;
            }
            return;
        }
示例#5
0
        private void btnStrataRst_Click(object sender, EventArgs e)
        {
            string outPath = null;
            string outName = "";

            ESRI.ArcGIS.CatalogUI.IGxDialog gxDialog = new ESRI.ArcGIS.CatalogUI.GxDialogClass();
            gxDialog.AllowMultiSelect = false;
            ESRI.ArcGIS.Catalog.IGxObjectFilter flt = null;
            flt = new ESRI.ArcGIS.Catalog.GxFilterRasterDatasetsClass();
            gxDialog.ObjectFilter = flt;
            gxDialog.Title        = "Select a Raster Dataset";
            ESRI.ArcGIS.Catalog.IEnumGxObject eGxObj;
            if (gxDialog.DoModalOpen(0, out eGxObj))
            {
                ESRI.ArcGIS.Catalog.IGxObject gxObj = eGxObj.Next();
                outPath = gxObj.FullName;
                outName = gxObj.BaseName;
                IRaster rs = rsUtil.returnRaster(outPath);
                if (!rstDic.ContainsKey(outName))
                {
                    rstDic.Add(outName, rs);
                    cmbStrataField.Items.Add(outName);
                }
                else
                {
                    rstDic[outName] = rs;
                }
                cmbStrataField.SelectedItem = outName;
            }
            return;
        }
示例#6
0
        private void getFeaturePath()
        {
            string outPath = null;
            string outName = "";

            ESRI.ArcGIS.CatalogUI.IGxDialog gxDialog = new ESRI.ArcGIS.CatalogUI.GxDialogClass();
            gxDialog.AllowMultiSelect = false;
            ESRI.ArcGIS.Catalog.IGxObjectFilter flt = null;
            flt = new ESRI.ArcGIS.Catalog.GxFilterTablesAndFeatureClassesClass();
            gxDialog.ObjectFilter = flt;
            gxDialog.Title        = "Select a Feature";
            ESRI.ArcGIS.Catalog.IEnumGxObject eGxObj;
            if (gxDialog.DoModalOpen(0, out eGxObj))
            {
                ESRI.ArcGIS.Catalog.IGxObject gxObj = eGxObj.Next();
                outPath = gxObj.FullName;
                outName = gxObj.BaseName;
                if (!ftrDic.ContainsKey(outName))
                {
                    ftrDic.Add(outName, geoUtil.getTable(outPath));
                    cmbSampleFeatureClass.Items.Add(outName);
                }
                else
                {
                    ftrDic[outName] = geoUtil.getTable(outPath);
                }
                cmbSampleFeatureClass.SelectedItem = outName;
            }
            return;
        }
示例#7
0
        private void getFeaturePath()
        {
            string outPath = null;
            string outName = "";

            ESRI.ArcGIS.CatalogUI.IGxDialog gxDialog = new ESRI.ArcGIS.CatalogUI.GxDialogClass();
            gxDialog.AllowMultiSelect = true;
            ESRI.ArcGIS.Catalog.IGxObjectFilter flt = null;
            flt = new ESRI.ArcGIS.Catalog.GxFilterRasterDatasetsClass();
            gxDialog.ObjectFilter = flt;
            gxDialog.Title        = "Select a Feature";
            ESRI.ArcGIS.Catalog.IEnumGxObject eGxObj;
            if (gxDialog.DoModalOpen(0, out eGxObj))
            {
                ESRI.ArcGIS.Catalog.IGxObject gxObj = eGxObj.Next();
                while (gxObj != null)
                {
                    outPath = gxObj.FullName;
                    outName = gxObj.BaseName;
                    IRaster rs = rsUtil.returnRaster(outPath);
                    if (((IRasterBandCollection)rs).Count > 1)
                    {
                        IRasterBandCollection rsBc = (IRasterBandCollection)rs;
                        for (int r = 0; r < rsBc.Count; r++)
                        {
                            string  nNm = outName + "_Band_" + (r + 1).ToString();
                            IRaster rsB = rsUtil.returnRaster(rsUtil.getBand(rs, r));
                            if (!rstDic.ContainsKey(nNm))
                            {
                                rstDic.Add(nNm, rsB);
                                //cmbInRaster1.Items.Add(nNm);
                                dgvRasterSlopes.Rows.Add(nNm, 0);
                            }
                            else
                            {
                                rstDic[nNm] = rsB;
                            }
                        }
                    }
                    else
                    {
                        if (!rstDic.ContainsKey(outName))
                        {
                            rstDic.Add(outName, rs);
                            //cmbInRaster1.Items.Add(outName);
                            dgvRasterSlopes.Rows.Add(outName, 0);
                        }
                        else
                        {
                            rstDic[outName] = rs;
                        }
                    }
                    gxObj = eGxObj.Next();
                }
            }
            return;
        }
示例#8
0
        private void getFeaturePath(bool featureClass)
        {
            string outPath = null;
            string outName = "";

            ESRI.ArcGIS.CatalogUI.IGxDialog gxDialog = new ESRI.ArcGIS.CatalogUI.GxDialogClass();
            gxDialog.AllowMultiSelect = false;
            ESRI.ArcGIS.Catalog.IGxObjectFilter flt = null;
            if (featureClass)
            {
                flt            = new ESRI.ArcGIS.Catalog.GxFilterWorkspacesClass();
                gxDialog.Title = "Select a Workspace";
            }
            else
            {
                flt            = new ESRI.ArcGIS.Catalog.GxFilterRasterDatasetsClass();
                gxDialog.Title = "Select a Raster";
            }
            gxDialog.ObjectFilter = flt;

            ESRI.ArcGIS.Catalog.IEnumGxObject eGxObj;
            if (gxDialog.DoModalOpen(0, out eGxObj))
            {
                ESRI.ArcGIS.Catalog.IGxObject gxObj = eGxObj.Next();
                outPath = gxObj.FullName;
                outName = gxObj.BaseName;
                if (featureClass)
                {
                    if (!ftrDic.ContainsKey(outName))
                    {
                        ftrDic.Add(outName, geoUtil.OpenWorkSpace(outPath));
                        cmbSampleFeatureClass.Items.Add(outName);
                    }
                    else
                    {
                        ftrDic[outName] = geoUtil.OpenWorkSpace(outPath);
                    }
                    cmbSampleFeatureClass.SelectedItem = outName;
                }
                else
                {
                    if (!rstDic.ContainsKey(outName))
                    {
                        rstDic.Add(outName, rstUtil.returnRaster(outPath));
                        cmbRasterBands.Items.Add(outName);
                    }
                    else
                    {
                        rstDic[outName] = rstUtil.returnRaster(outPath);
                    }
                    cmbRasterBands.Text = outName;
                }
            }
            return;
        }
示例#9
0
        private void getFeaturePath(object sender, EventArgs e)
        {
            Control cnt     = (Control)sender;
            string  cntName = cnt.Name;
            TextBox txtBox  = txtPop;

            if (cntName == btnSamp.Name)
            {
                txtBox = txtSamp;
            }
            string outPath = null;
            string outName = "";

            ESRI.ArcGIS.CatalogUI.IGxDialog gxDialog = new ESRI.ArcGIS.CatalogUI.GxDialogClass();
            gxDialog.AllowMultiSelect = false;
            ESRI.ArcGIS.Catalog.IGxObjectFilter flt = null;
            flt = new ESRI.ArcGIS.Catalog.GxFilterTablesAndFeatureClassesClass();
            gxDialog.ObjectFilter = flt;
            gxDialog.Title        = "Select a Feature Class or Table";
            ESRI.ArcGIS.Catalog.IEnumGxObject eGxObj;
            if (gxDialog.DoModalOpen(0, out eGxObj))
            {
                ESRI.ArcGIS.Catalog.IGxObject gxObj = eGxObj.Next();
                outPath = gxObj.FullName;
                outName = gxObj.BaseName;
                IRaster rs = rsUtil.returnRaster(outPath);
                if (rs == null)
                {
                    if (!ftrDic.ContainsKey(outName))
                    {
                        ftrDic.Add(outName, geoUtil.getTable(outPath));
                    }
                    else
                    {
                        ftrDic[outName] = geoUtil.getTable(outPath);
                    }
                }
                else
                {
                    if (!rstDic.ContainsKey(outName))
                    {
                        rstDic.Add(outName, rs);
                    }
                    else
                    {
                        rstDic[outName] = rs;
                    }
                }
                txtBox.Text = outName;
            }
            updateFieldComboBox();
            return;
        }
示例#10
0
        private void getRasterOrFeaturePath()
        {
            string outPath = null;
            string outName = "";

            ESRI.ArcGIS.CatalogUI.IGxDialog gxDialog = new ESRI.ArcGIS.CatalogUI.GxDialogClass();
            ESRI.ArcGIS.Catalog.IGxObjectFilterCollection fltColl = (ESRI.ArcGIS.Catalog.IGxObjectFilterCollection)gxDialog;
            gxDialog.AllowMultiSelect = false;
            ESRI.ArcGIS.Catalog.IGxObjectFilter flt  = new ESRI.ArcGIS.Catalog.GxFilterRasterDatasetsClass();
            ESRI.ArcGIS.Catalog.IGxObjectFilter flt2 = new ESRI.ArcGIS.Catalog.GxFilterPolygonFeatureClassesClass();
            fltColl.AddFilter(flt, true);
            fltColl.AddFilter(flt2, false);
            gxDialog.Title = "Select a Raster Polygon Dataset";
            ESRI.ArcGIS.Catalog.IEnumGxObject eGxObj;
            if (gxDialog.DoModalOpen(0, out eGxObj))
            {
                ESRI.ArcGIS.Catalog.IGxObject gxObj = eGxObj.Next();
                while (gxObj != null)
                {
                    outPath = gxObj.FullName;
                    outName = gxObj.BaseName;
                    if (gxDialog.ObjectFilter is ESRI.ArcGIS.Catalog.GxFilterRasterDatasetsClass)
                    {
                        IRaster rs = rsUtil.returnRaster(outPath);
                        if (!rstDic.ContainsKey(outName))
                        {
                            rstDic.Add(outName, rs);
                            cmbZoneRaster.Items.Add(outName);
                        }
                        else
                        {
                            rstDic[outName] = rs;
                        }
                    }
                    else
                    {
                        IFeatureClass ftrCls = geoUtil.getFeatureClass(outPath);
                        if (!ftrDic.ContainsKey(outName))
                        {
                            ftrDic.Add(outName, ftrCls);
                            cmbZoneRaster.Items.Add(outName);
                        }
                        else
                        {
                            ftrDic[outName] = ftrCls;
                        }
                    }
                    gxObj = eGxObj.Next();
                }
                cmbZoneRaster.SelectedItem = outName;
            }
            return;
        }
示例#11
0
 private void getTablePath()
 {
     ESRI.ArcGIS.CatalogUI.IGxDialog     gxDialog = new ESRI.ArcGIS.CatalogUI.GxDialogClass();
     ESRI.ArcGIS.Catalog.IGxObjectFilter flt      = null;
     flt = new ESRI.ArcGIS.Catalog.GxFilterTablesClass();
     gxDialog.ObjectFilter = flt;
     gxDialog.Title        = "Save Output Table";
     if (gxDialog.DoModalSave(0))
     {
         txtOutNm.Text = gxDialog.FinalLocation.FullName + "\\" + gxDialog.Name;
     }
     return;
 }
示例#12
0
 private void getTablePath()
 {
     ESRI.ArcGIS.CatalogUI.IGxDialog gxDialog = new ESRI.ArcGIS.CatalogUI.GxDialogClass();
     gxDialog.AllowMultiSelect = false;
     ESRI.ArcGIS.Catalog.IGxObjectFilter flt = null;
     flt = new ESRI.ArcGIS.Catalog.GxFilterTablesClass();//.GxFilterRasterDatasetsClass();
     gxDialog.ObjectFilter = flt;
     gxDialog.Title        = "Save Output Table";
     if (gxDialog.DoModalSave(0))
     {
         txtTableName.Text = gxDialog.FinalLocation.FullName + "\\" + gxDialog.Name;
     }
     return;
 }
示例#13
0
 private void btnGeoDb_Click(object sender, EventArgs e)
 {
     ESRI.ArcGIS.CatalogUI.IGxDialog gxDialog = new ESRI.ArcGIS.CatalogUI.GxDialogClass();
     gxDialog.AllowMultiSelect = false;
     ESRI.ArcGIS.Catalog.IGxObjectFilter flt = new ESRI.ArcGIS.Catalog.GxFilterFileGeodatabasesClass();
     gxDialog.ObjectFilter = flt;
     gxDialog.Title        = "Select a File geodatabase to store tiles";
     ESRI.ArcGIS.Catalog.IEnumGxObject eGxObj;
     if (gxDialog.DoModalOpen(0, out eGxObj))
     {
         ESRI.ArcGIS.Catalog.IGxObject gxObj = eGxObj.Next();
         txtGeoDb.Text = gxObj.FullName;
     }
 }
示例#14
0
        public string getPathSave(ESRI.ArcGIS.Catalog.IGxObjectFilter filter, out string outName)
        {
            string outPath = "";

            outName = "";
            ESRI.ArcGIS.CatalogUI.IGxDialog gxDialog = new ESRI.ArcGIS.CatalogUI.GxDialogClass();
            gxDialog.ObjectFilter = filter;
            gxDialog.Title        = filter.Description;
            if (gxDialog.DoModalSave(0))
            {
                outName = gxDialog.Name;
                outPath = gxDialog.FinalLocation.FullName + "\\" + outName;
            }
            return(outPath);
        }
示例#15
0
 private void btnOpenWorkspace_Click(object sender, EventArgs e)
 {
     ESRI.ArcGIS.CatalogUI.IGxDialog gxDialog = new ESRI.ArcGIS.CatalogUI.GxDialogClass();
     gxDialog.AllowMultiSelect = false;
     ESRI.ArcGIS.Catalog.IGxObjectFilter flt = null;
     flt = new ESRI.ArcGIS.Catalog.GxFilterWorkspacesClass();
     gxDialog.ObjectFilter = flt;
     gxDialog.Title        = "Select a Workspace";
     ESRI.ArcGIS.Catalog.IEnumGxObject eGxObj;
     if (gxDialog.DoModalOpen(0, out eGxObj))
     {
         ESRI.ArcGIS.Catalog.IGxObject gxObj = eGxObj.Next();
         txtLandFireDir.Text = gxObj.FullName;
     }
 }
 private void btnOpenWorkspace_Click(object sender, EventArgs e)
 {
     ESRI.ArcGIS.CatalogUI.IGxDialog gxDialog = new ESRI.ArcGIS.CatalogUI.GxDialogClass();
     gxDialog.AllowMultiSelect = false;
     ESRI.ArcGIS.Catalog.IGxObjectFilter flt = null;
     flt = new ESRI.ArcGIS.Catalog.GxFilterWorkspacesClass();
     gxDialog.ObjectFilter = flt;
     gxDialog.Title = "Select a Workspace";
     ESRI.ArcGIS.Catalog.IEnumGxObject eGxObj;
     if (gxDialog.DoModalOpen(0, out eGxObj))
     {
         ESRI.ArcGIS.Catalog.IGxObject gxObj = eGxObj.Next();
         txtLandFireDir.Text = gxObj.FullName;
     }
 }
示例#17
0
        private void getFeaturePathMap()
        {
            string outPath = null;
            string outName = "";

            ESRI.ArcGIS.CatalogUI.IGxDialog gxDialog = new ESRI.ArcGIS.CatalogUI.GxDialogClass();
            gxDialog.AllowMultiSelect = false;
            ESRI.ArcGIS.Catalog.IGxObjectFilter flt = null;
            flt = new ESRI.ArcGIS.Catalog.GxFilterGeoDatasetsClass();
            gxDialog.ObjectFilter = flt;
            gxDialog.Title        = "Select a Feature or Raster Class";
            ESRI.ArcGIS.Catalog.IEnumGxObject eGxObj;
            if (gxDialog.DoModalOpen(0, out eGxObj))
            {
                ESRI.ArcGIS.Catalog.IGxObject gxObj = eGxObj.Next();
                outPath = gxObj.FullName;
                outName = gxObj.BaseName;
                IRaster rs = rsUtil.returnRaster(outPath);
                if (rs == null)
                {
                    if (!ftrDic.ContainsKey(outName))
                    {
                        ftrDic.Add(outName, geoUtil.getFeatureClass(outPath));
                        cmbMap.Items.Add(outName);
                    }
                    else
                    {
                        ftrDic[outName] = geoUtil.getFeatureClass(outPath);
                    }
                }
                else
                {
                    if (!rstDic.ContainsKey(outName))
                    {
                        rstDic.Add(outName, rsUtil.returnRaster(outPath));
                        cmbMap.Items.Add(outName);
                    }
                    else
                    {
                        rstDic[outName] = rsUtil.returnRaster(outPath);
                    }
                }
                cmbMap.SelectedItem = outName;
            }
            return;
        }
示例#18
0
        private void btnOpenTable_Click(object sender, EventArgs e)
        {
            ComboBox cmb = cmbStrata;

            if (((Button)sender).Name.ToLower().Contains("stands"))
            {
                cmb = cmbStands;
            }
            string outPath = null;
            string outName = "";

            ESRI.ArcGIS.CatalogUI.IGxDialog gxDialog = new ESRI.ArcGIS.CatalogUI.GxDialogClass();
            ESRI.ArcGIS.Catalog.IGxObjectFilterCollection fltColl = (ESRI.ArcGIS.Catalog.IGxObjectFilterCollection)gxDialog;
            gxDialog.AllowMultiSelect = false;
            ESRI.ArcGIS.Catalog.IGxObjectFilter flt2 = new ESRI.ArcGIS.Catalog.GxFilterPolygonFeatureClassesClass();
            fltColl.AddFilter(flt2, false);
            gxDialog.Title = "Select a Feature Class";
            ESRI.ArcGIS.Catalog.IEnumGxObject eGxObj;
            if (gxDialog.DoModalOpen(0, out eGxObj))
            {
                ESRI.ArcGIS.Catalog.IGxObject gxObj = eGxObj.Next();
                while (gxObj != null)
                {
                    outPath = gxObj.FullName;
                    outName = gxObj.BaseName;


                    IFeatureClass ftrCls = geoUtil.getFeatureClass(outPath);//need to check if this works for feature classes
                    if (!ftrDic.ContainsKey(outName))
                    {
                        ftrDic.Add(outName, ftrCls);
                        cmb.Items.Add(outName);
                    }
                    else
                    {
                        ftrDic[outName] = ftrCls;
                    }

                    gxObj = eGxObj.Next();
                }
                cmb.SelectedItem = outName;
            }
            return;
        }
示例#19
0
 private void btnOpenFeatureClass_Click(object sender, EventArgs e)
 {
     ESRI.ArcGIS.CatalogUI.IGxDialog gxDialog = new ESRI.ArcGIS.CatalogUI.GxDialogClass();
     gxDialog.AllowMultiSelect = false;
     ESRI.ArcGIS.Catalog.IGxObjectFilter flt = null;
     flt = new ESRI.ArcGIS.Catalog.GxFilterPolygonFeatureClassesClass();
     gxDialog.ObjectFilter = flt;
     gxDialog.Title        = "Select a RCZ Layer";
     ESRI.ArcGIS.Catalog.IEnumGxObject eGxObj;
     if (gxDialog.DoModalOpen(0, out eGxObj))
     {
         ESRI.ArcGIS.Catalog.IGxObject gxObj = eGxObj.Next();
         string        nm     = gxObj.Name;
         IFeatureClass ftrCls = geoUtil.getFeatureClass(gxObj.FullName);
         ftrDic.Add(nm, ftrCls);
         cmbInFeatureClass.Items.Add(nm);
         cmbInFeatureClass.SelectedItem = nm;
     }
 }
示例#20
0
        private void getFeaturePath(Control cmb, ESRI.ArcGIS.Catalog.IGxObjectFilter flt)
        {
            string outPath = null;
            string outName = "";

            ESRI.ArcGIS.CatalogUI.IGxDialog gxDialog = new ESRI.ArcGIS.CatalogUI.GxDialogClass();
            gxDialog.AllowMultiSelect = false;
            gxDialog.ObjectFilter     = flt;
            gxDialog.Title            = "Select a Feature";
            ESRI.ArcGIS.Catalog.IEnumGxObject eGxObj;
            if (gxDialog.DoModalOpen(0, out eGxObj))
            {
                ESRI.ArcGIS.Catalog.IGxObject gxObj = eGxObj.Next();
                outPath = gxObj.FullName;
                outName = gxObj.BaseName;
                if (cmb.Name.ToLower() == "cmbraster")
                {
                    IRaster oRs = null;
                    if (!rstDic.ContainsKey(outName))
                    {
                        oRs = rsUtil.returnRaster(outPath);
                        rstDic.Add(outName, oRs);
                        cmbRaster.Items.Add(outName);
                    }
                    else
                    {
                        oRs             = rsUtil.returnRaster(outPath);
                        rstDic[outName] = oRs;
                    }
                    object ndv = ((IRasterProps)((IRasterBandCollection)oRs).Item(0)).NoDataValue;
                    //txtNoData.Text = (ndv.ToString());
                }
                else
                {
                    outWks = geoUtil.OpenRasterWorkspace(outPath);
                }
                cmb.Text = outName;
            }
            return;
        }
示例#21
0
        private ITable getTableFromUser()
        {
            ITable outTbl  = null;
            string outPath = null;
            string outName = "";

            ESRI.ArcGIS.CatalogUI.IGxDialog gxDialog = new ESRI.ArcGIS.CatalogUI.GxDialogClass();
            gxDialog.AllowMultiSelect = false;
            ESRI.ArcGIS.Catalog.IGxObjectFilter flt = null;
            flt = new ESRI.ArcGIS.Catalog.GxFilterTablesAndFeatureClassesClass();
            gxDialog.ObjectFilter = flt;
            gxDialog.Title        = "Supplemental Table";
            ESRI.ArcGIS.Catalog.IEnumGxObject eGxObj;
            if (gxDialog.DoModalOpen(0, out eGxObj))
            {
                ESRI.ArcGIS.Catalog.IGxObject gxObj = eGxObj.Next();
                outPath = gxObj.FullName;
                outName = gxObj.BaseName;
                outTbl  = geoUtil.getTable(outPath);
            }
            return(outTbl);
        }
示例#22
0
        private IRaster getSeedRaster()
        {
            IRaster rsOut   = null;
            string  outPath = null;
            string  outName = "";

            ESRI.ArcGIS.CatalogUI.IGxDialog gxDialog = new ESRI.ArcGIS.CatalogUI.GxDialogClass();
            gxDialog.AllowMultiSelect = false;
            ESRI.ArcGIS.Catalog.IGxObjectFilter flt = null;
            flt = new ESRI.ArcGIS.Catalog.GxFilterRasterDatasetsClass();
            gxDialog.ObjectFilter = flt;
            gxDialog.Title        = "Select a Seed Raster";
            ESRI.ArcGIS.Catalog.IEnumGxObject eGxObj;
            if (gxDialog.DoModalOpen(0, out eGxObj))
            {
                ESRI.ArcGIS.Catalog.IGxObject gxObj = eGxObj.Next();
                outPath = gxObj.FullName;
                outName = gxObj.BaseName;
                rsOut   = rstUtil.returnRaster(outPath);
            }
            return(rsOut);
        }
示例#23
0
        public string[] getPath(ESRI.ArcGIS.Catalog.IGxObjectFilter filter, out string[] outName, bool MultiSelect = false)
        {
            List <string> outLst     = new List <string>();
            List <string> outNameLst = new List <string>();

            ESRI.ArcGIS.CatalogUI.IGxDialog gxDialog = new ESRI.ArcGIS.CatalogUI.GxDialogClass();
            gxDialog.AllowMultiSelect = MultiSelect;
            gxDialog.ObjectFilter     = filter;
            gxDialog.Title            = filter.Description;
            ESRI.ArcGIS.Catalog.IEnumGxObject eGxObj;
            if (gxDialog.DoModalOpen(0, out eGxObj))
            {
                ESRI.ArcGIS.Catalog.IGxObject gxObj = eGxObj.Next();
                while (gxObj != null)
                {
                    outLst.Add(gxObj.FullName);
                    outNameLst.Add(gxObj.BaseName);
                    gxObj = eGxObj.Next();
                }
            }
            outName = outNameLst.ToArray();
            return(outLst.ToArray());
        }
示例#24
0
        private void btnOpenStands_Click(object sender, EventArgs e)
        {
            string outPath = null;
            string outName = "";

            ESRI.ArcGIS.CatalogUI.IGxDialog gxDialog = new ESRI.ArcGIS.CatalogUI.GxDialogClass();
            ESRI.ArcGIS.Catalog.IGxObjectFilterCollection fltColl = (ESRI.ArcGIS.Catalog.IGxObjectFilterCollection)gxDialog;
            gxDialog.AllowMultiSelect = false;
            ESRI.ArcGIS.Catalog.IGxObjectFilter flt2 = new ESRI.ArcGIS.Catalog.GxFilterPolygonFeatureClassesClass();
            fltColl.AddFilter(flt2, false);
            gxDialog.Title = "Select a Stands Feature Class";
            ESRI.ArcGIS.Catalog.IEnumGxObject eGxObj;
            if (gxDialog.DoModalOpen(0, out eGxObj))
            {
                ESRI.ArcGIS.Catalog.IGxObject gxObj = eGxObj.Next();
                while (gxObj != null)
                {
                    outPath = gxObj.FullName;
                    outName = gxObj.BaseName;

                    IFeatureClass ftrCls = geoUtil.getFeatureClass(outPath);
                    if (!ftrDic.ContainsKey(outName))
                    {
                        ftrDic.Add(outName, ftrCls);
                        cmbStands.Items.Add(outName);
                    }
                    else
                    {
                        ftrDic[outName] = ftrCls;
                    }

                    gxObj = eGxObj.Next();
                }
                cmbStands.SelectedItem = outName;
            }
            return;
        }
示例#25
0
        private void btnOpenTable_Click(object sender, EventArgs e)
        {
            string outPath = null;
            string outName = "";

            ESRI.ArcGIS.CatalogUI.IGxDialog gxDialog = new ESRI.ArcGIS.CatalogUI.GxDialogClass();
            ESRI.ArcGIS.Catalog.IGxObjectFilterCollection fltColl = (ESRI.ArcGIS.Catalog.IGxObjectFilterCollection)gxDialog;
            gxDialog.AllowMultiSelect = false;
            ESRI.ArcGIS.Catalog.IGxObjectFilter flt2 = new ESRI.ArcGIS.Catalog.GxFilterTablesAndFeatureClassesClass();
            fltColl.AddFilter(flt2, false);
            gxDialog.Title = "Select a Table or Feature Class";
            ESRI.ArcGIS.Catalog.IEnumGxObject eGxObj;
            if (gxDialog.DoModalOpen(0, out eGxObj))
            {
                ESRI.ArcGIS.Catalog.IGxObject gxObj = eGxObj.Next();
                while (gxObj != null)
                {
                    outPath = gxObj.FullName;
                    outName = gxObj.BaseName;

                    ITable tbl = geoUtil.getTable(outPath);//need to check if this works for feature classes
                    if (!tblDic.ContainsKey(outName))
                    {
                        tblDic.Add(outName, tbl);
                        cmbTable.Items.Add(outName);
                    }
                    else
                    {
                        tblDic[outName] = tbl;
                    }

                    gxObj = eGxObj.Next();
                }
                cmbTable.SelectedItem = outName;
            }
            return;
        }
 private string getFeaturePath(string ftNm, bool featureClass)
 {
     string outPath = null;
     ESRI.ArcGIS.CatalogUI.IGxDialog gxDialog = new ESRI.ArcGIS.CatalogUI.GxDialogClass();
     gxDialog.AllowMultiSelect = false;
     ESRI.ArcGIS.Catalog.IGxObjectFilter flt = null;
     if (featureClass)
     {
         flt = new ESRI.ArcGIS.Catalog.GxFilterPolygonFeatureClassesClass();
     }
     else
     {
         flt = new ESRI.ArcGIS.Catalog.GxFilterRasterDatasetsClass();
     }
     gxDialog.ObjectFilter = flt;
     gxDialog.Title = "Can't Find Feature " + ftNm;
     ESRI.ArcGIS.Catalog.IEnumGxObject eGxObj;
     if (gxDialog.DoModalOpen(0, out eGxObj))
     {
         ESRI.ArcGIS.Catalog.IGxObject gxObj = eGxObj.Next();
         outPath = gxObj.FullName;
     }
     return outPath;
 }
 private void getPath(bool isRaster)
 {
     string outPath = null;
     string outName = "";
     ESRI.ArcGIS.CatalogUI.IGxDialog gxDialog = new ESRI.ArcGIS.CatalogUI.GxDialogClass();
     gxDialog.AllowMultiSelect = false;
     ESRI.ArcGIS.Catalog.IGxObjectFilter flt = null;
     if (isRaster)
     {
         flt = new ESRI.ArcGIS.Catalog.GxFilterRasterDatasetsClass();
     }
     else
     {
         flt = new ESRI.ArcGIS.Catalog.GxFilterFileGeodatabasesClass();
     }
     gxDialog.ObjectFilter = flt;
     gxDialog.Title = "Select a Feature";
     ESRI.ArcGIS.Catalog.IEnumGxObject eGxObj;
     if (gxDialog.DoModalOpen(0, out eGxObj))
     {
         ESRI.ArcGIS.Catalog.IGxObject gxObj = eGxObj.Next();
         outPath = gxObj.FullName;
         outName = gxObj.BaseName;
         if (isRaster)
         {
             if (!rstDic.ContainsKey(outName))
             {
                 rstDic.Add(outName, rsUtil.returnRaster(outPath));
                 cmbRst.Items.Add(outName);
             }
             else
             {
                 rstDic[outName] = rsUtil.returnRaster(outPath);
             }
             cmbRst.Text = outName;
         }
         else
         {
             txtOutWorkspace.Text = outPath;
         }
     }
     return;
 }
 private void btnSave_Click(object sender, EventArgs e)
 {
     try
     {
         int rwCnt = dgvOutputs.Rows.Count;
         bool chCheck = false;
         for (int i = 0; i < rwCnt; i++)
         {
             DataGridViewCellCollection cells = dgvOutputs.Rows[i].Cells;
             bool ch = System.Convert.ToBoolean(cells[1].Value);
             if (ch)
             {
                 chCheck = true;
                 break;
             }
         }
         if (chCheck)
         {
             ESRI.ArcGIS.CatalogUI.IGxDialog gxDialog = new ESRI.ArcGIS.CatalogUI.GxDialogClass();
             gxDialog.AllowMultiSelect = false;
             ESRI.ArcGIS.Catalog.IGxObjectFilter flt = null;
             flt = new ESRI.ArcGIS.Catalog.GxFilterWorkspacesClass();
             gxDialog.ObjectFilter = flt;
             gxDialog.Title = "Select a Workspace";
             ESRI.ArcGIS.Catalog.IEnumGxObject eGxObj;
             if (gxDialog.DoModalOpen(0, out eGxObj))
             {
                 ESRI.ArcGIS.Catalog.IGxObject gxObj = eGxObj.Next();
                 outFunctionDatasetDir = gxObj.FullName + "\\" + funcDirNm;
                 geoUtil.check_dir(outFunctionDatasetDir);
                 for (int i = 0; i < rwCnt; i++)
                 {
                     DataGridViewCellCollection cells = dgvOutputs.Rows[i].Cells;
                     bool ch = System.Convert.ToBoolean(cells[1].Value);
                     if (ch)
                     {
                         string nm = cells[0].Value.ToString();
                         string newNm = nm;
                         char[] bChr = System.IO.Path.GetInvalidFileNameChars();
                         foreach (char c in bChr)
                         {
                             newNm = newNm.Replace(c, '_');
                         }
                         foreach (string s in new string[] { ":", ";", "?", ">", "<", "`", "~", "!", ".", ",", "@", "#", "$", "%", "^", "&", "*", "(", ")", "+", "=", "-" })
                         {
                             newNm = newNm.Replace(s, "_");
                         }
                         string outFilePath = outFunctionDatasetDir + "\\" + newNm + funcExt;
                         //Console.WriteLine(outFilePath);
                         string dsc = cells[2].Value.ToString();
                         using (System.IO.StreamWriter sWr = new System.IO.StreamWriter(outFilePath))
                         {
                             string lns = getSubFunctions(nm, dsc,null);
                             if (lns.Length > 0)
                             {
                                 sWr.WriteLine(lns);
                             }
                             sWr.Close();
                         }
                     }
                 }
             }
         }
         else
         {
             MessageBox.Show("To save a model you must have at least 1 model checked", "No models checked!", MessageBoxButtons.OK, MessageBoxIcon.Information);
         }
     }
     catch (Exception ex)
     {
         Console.WriteLine(ex.ToString());
     }
     finally
     {
     }
 }
 private void getTablePath()
 {
     ESRI.ArcGIS.CatalogUI.IGxDialog gxDialog = new ESRI.ArcGIS.CatalogUI.GxDialogClass();
     ESRI.ArcGIS.Catalog.IGxObjectFilter flt = null;
     flt = new ESRI.ArcGIS.Catalog.GxFilterTablesClass();
     gxDialog.ObjectFilter = flt;
     gxDialog.Title = "Save Output Table";
     if (gxDialog.DoModalSave(0))
     {
         txtOutNm.Text = gxDialog.FinalLocation.FullName + "\\" + gxDialog.Name;
     }
     return;
 }
        private void getWksPath()
        {
            string outPath = null;
            string outName = "";
            ESRI.ArcGIS.CatalogUI.IGxDialog gxDialog = new ESRI.ArcGIS.CatalogUI.GxDialogClass();
            gxDialog.AllowMultiSelect = false;
            ESRI.ArcGIS.Catalog.IGxObjectFilter flt = new ESRI.ArcGIS.Catalog.GxFilterFileGeodatabasesClass();
            gxDialog.ObjectFilter = flt;
            gxDialog.Title = "Select or create a Workspace";
            ESRI.ArcGIS.Catalog.IEnumGxObject eGxObj;
            if (gxDialog.DoModalOpen(0, out eGxObj))
            {
                ESRI.ArcGIS.Catalog.IGxObject gxObj = eGxObj.Next();
                outPath = gxObj.FullName;
                outName = gxObj.BaseName;
                outWks = geoUtil.OpenWorkSpace(outPath);
                txtWorkspace.Text = outName;

            }
            return;
        }
 private ITable getTableFromUser()
 {
     ITable outTbl = null;
     string outPath = null;
     string outName = "";
     ESRI.ArcGIS.CatalogUI.IGxDialog gxDialog = new ESRI.ArcGIS.CatalogUI.GxDialogClass();
     gxDialog.AllowMultiSelect = false;
     ESRI.ArcGIS.Catalog.IGxObjectFilter flt = null;
     flt = new ESRI.ArcGIS.Catalog.GxFilterTablesAndFeatureClassesClass();
     gxDialog.ObjectFilter = flt;
     gxDialog.Title = "Supplemental Table";
     ESRI.ArcGIS.Catalog.IEnumGxObject eGxObj;
     if (gxDialog.DoModalOpen(0, out eGxObj))
     {
         ESRI.ArcGIS.Catalog.IGxObject gxObj = eGxObj.Next();
         outPath = gxObj.FullName;
         outName = gxObj.BaseName;
         outTbl = geoUtil.getTable(outPath);
     }
     return outTbl;
 }
 private void getFeaturePath()
 {
     string outPath = null;
     string outName = "";
     ESRI.ArcGIS.CatalogUI.IGxDialog gxDialog = new ESRI.ArcGIS.CatalogUI.GxDialogClass();
     gxDialog.AllowMultiSelect = false;
     ESRI.ArcGIS.Catalog.IGxObjectFilter flt = null;
     flt = new ESRI.ArcGIS.Catalog.GxFilterTablesAndFeatureClassesClass();
     gxDialog.ObjectFilter = flt;
     gxDialog.Title = "Select a Feature";
     ESRI.ArcGIS.Catalog.IEnumGxObject eGxObj;
     if (gxDialog.DoModalOpen(0, out eGxObj))
     {
         ESRI.ArcGIS.Catalog.IGxObject gxObj = eGxObj.Next();
         outPath = gxObj.FullName;
         outName = gxObj.BaseName;
         if (!ftrDic.ContainsKey(outName))
         {
             ftrDic.Add(outName, geoUtil.getTable(outPath));
             cmbSampleFeatureClass.Items.Add(outName);
         }
         else
         {
             ftrDic[outName] = geoUtil.getTable(outPath);
         }
         cmbSampleFeatureClass.SelectedItem = outName;
     }
     return;
 }
        private void getFeaturePath(bool featureClass)
        {
            string outPath = null;
            string outName = "";
            ESRI.ArcGIS.CatalogUI.IGxDialog gxDialog = new ESRI.ArcGIS.CatalogUI.GxDialogClass();
            gxDialog.AllowMultiSelect = false;
            ESRI.ArcGIS.Catalog.IGxObjectFilter flt = null;
            if (featureClass)
            {
                flt = new ESRI.ArcGIS.Catalog.GxFilterPointFeatureClassesClass();
            }
            else
            {
                flt = new ESRI.ArcGIS.Catalog.GxFilterRasterDatasetsClass();
            }
            gxDialog.ObjectFilter = flt;
            gxDialog.Title = "Select a Feature";
            ESRI.ArcGIS.Catalog.IEnumGxObject eGxObj;
            if (gxDialog.DoModalOpen(0, out eGxObj))
            {
                ESRI.ArcGIS.Catalog.IGxObject gxObj = eGxObj.Next();
                outPath = gxObj.FullName;
                outName = gxObj.BaseName;
                if (featureClass)
                {
                    if (!ftrDic.ContainsKey(outName))
                    {
                        ftrDic.Add(outName, geoUtil.getFeatureClass(outPath));
                        cmbSampleFeatureClass.Items.Add(outName);
                    }
                    else
                    {
                        ftrDic[outName] = geoUtil.getFeatureClass(outPath);
                    }
                    cmbSampleFeatureClass.Text = outName;
                }
                else
                {
                    if (!rstDic.ContainsKey(outName))
                    {
                        rstDic.Add(outName, rsUtil.returnRaster(outPath));
                        cmbRaster.Items.Add(outName);
                    }
                    else
                    {
                        rstDic[outName] = rsUtil.returnRaster(outPath);
                    }
                    cmbRaster.Text = outName;
                }

            }
            return;
        }
 private void getZoneSummaryPath()
 {
     string outPath = null;
     string outName = "";
     ESRI.ArcGIS.CatalogUI.IGxDialog gxDialog = new ESRI.ArcGIS.CatalogUI.GxDialogClass();
     gxDialog.AllowMultiSelect = true;
     ESRI.ArcGIS.Catalog.IGxObjectFilter flt = null;
     flt = new ESRI.ArcGIS.Catalog.GxFilterTablesClass();
     gxDialog.ObjectFilter = flt;
     gxDialog.Title = "Select a Table";
     ESRI.ArcGIS.Catalog.IEnumGxObject eGxObj;
     if (gxDialog.DoModalOpen(0, out eGxObj))
     {
         ESRI.ArcGIS.Catalog.IGxObject gxObj = eGxObj.Next();
         while (gxObj != null)
         {
             outPath = gxObj.FullName;
             outName = gxObj.BaseName;
             ITable rs = geoUtil.getTable(outPath);
             if (!rstDic.ContainsKey(outName))
             {
                 rstDic.Add(outName, rs);
             }
             else
             {
                 rstDic[outName] = rs;
             }
             gxObj = eGxObj.Next();
         }
         txtOutputPath.Text = outName;
     }
     return;
 }
 private IRaster getSeedRaster()
 {
     IRaster rsOut = null;
     string outPath = null;
     string outName = "";
     ESRI.ArcGIS.CatalogUI.IGxDialog gxDialog = new ESRI.ArcGIS.CatalogUI.GxDialogClass();
     gxDialog.AllowMultiSelect = false;
     ESRI.ArcGIS.Catalog.IGxObjectFilter flt = null;
     flt = new ESRI.ArcGIS.Catalog.GxFilterRasterDatasetsClass();
     gxDialog.ObjectFilter = flt;
     gxDialog.Title = "Select a Seed Raster";
     ESRI.ArcGIS.Catalog.IEnumGxObject eGxObj;
     if (gxDialog.DoModalOpen(0, out eGxObj))
     {
         ESRI.ArcGIS.Catalog.IGxObject gxObj = eGxObj.Next();
         outPath = gxObj.FullName;
         outName = gxObj.BaseName;
         rsOut = rstUtil.returnRaster(outPath);
     }
     return rsOut;
 }
 private void btnOpenFeatureClass_Click(object sender, EventArgs e)
 {
     ESRI.ArcGIS.CatalogUI.IGxDialog gxDialog = new ESRI.ArcGIS.CatalogUI.GxDialogClass();
     gxDialog.AllowMultiSelect = false;
     ESRI.ArcGIS.Catalog.IGxObjectFilter flt = null;
     flt = new ESRI.ArcGIS.Catalog.GxFilterPolygonFeatureClassesClass();
     gxDialog.ObjectFilter = flt;
     gxDialog.Title = "Select a RCZ Layer";
     ESRI.ArcGIS.Catalog.IEnumGxObject eGxObj;
     if (gxDialog.DoModalOpen(0, out eGxObj))
     {
         ESRI.ArcGIS.Catalog.IGxObject gxObj = eGxObj.Next();
         string nm = gxObj.Name;
         IFeatureClass ftrCls = geoUtil.getFeatureClass(gxObj.FullName);
         ftrDic.Add(nm,ftrCls);
         cmbInFeatureClass.Items.Add(nm);
         cmbInFeatureClass.SelectedItem = nm;
     }
 }
 private void btnStrataRst_Click(object sender, EventArgs e)
 {
     string outPath = null;
     string outName = "";
     ESRI.ArcGIS.CatalogUI.IGxDialog gxDialog = new ESRI.ArcGIS.CatalogUI.GxDialogClass();
     gxDialog.AllowMultiSelect = false;
     ESRI.ArcGIS.Catalog.IGxObjectFilter flt = null;
     flt = new ESRI.ArcGIS.Catalog.GxFilterRasterDatasetsClass();
     gxDialog.ObjectFilter = flt;
     gxDialog.Title = "Select a Raster Dataset";
     ESRI.ArcGIS.Catalog.IEnumGxObject eGxObj;
     if (gxDialog.DoModalOpen(0, out eGxObj))
     {
         ESRI.ArcGIS.Catalog.IGxObject gxObj = eGxObj.Next();
         outPath = gxObj.FullName;
         outName = gxObj.BaseName;
         IRaster rs = rsUtil.returnRaster(outPath);
         if (!rstDic.ContainsKey(outName))
         {
             rstDic.Add(outName, rs);
             cmbStrataField.Items.Add(outName);
         }
         else
         {
             rstDic[outName] = rs;
         }
         cmbStrataField.SelectedItem = outName;
     }
     return;
 }
示例#38
0
        private void getFeaturePath(bool featureClass)
        {
            string outPath = null;
            string outName = "";

            ESRI.ArcGIS.CatalogUI.IGxDialog gxDialog = new ESRI.ArcGIS.CatalogUI.GxDialogClass();
            gxDialog.AllowMultiSelect = false;
            ESRI.ArcGIS.Catalog.IGxObjectFilter flt = null;
            if (featureClass)
            {
                flt = new ESRI.ArcGIS.Catalog.GxFilterPointFeatureClassesClass();
            }
            else
            {
                flt = new ESRI.ArcGIS.Catalog.GxFilterDatasets();
            }
            gxDialog.ObjectFilter = flt;
            gxDialog.Title        = "Select";
            ESRI.ArcGIS.Catalog.IEnumGxObject eGxObj;
            if (gxDialog.DoModalOpen(0, out eGxObj))
            {
                ESRI.ArcGIS.Catalog.IGxObject gxObj = eGxObj.Next();
                outPath = gxObj.FullName;
                outName = gxObj.BaseName;
                if (featureClass)
                {
                    ftrDic[outName] = geoUtil.getFeatureClass(outPath);
                    cmbSampleFeatureClass.Items.Add(outName);
                    cmbSampleFeatureClass.Text = outName;
                }
                else
                {
                    string       wksPath = geoUtil.getDatabasePath(outPath);
                    IWorkspace   wks     = geoUtil.OpenWorkSpace(wksPath);
                    IEnumDataset rsDset  = wks.get_Datasets(esriDatasetType.esriDTAny);
                    bool         rsCheck = false;
                    IDataset     ds      = rsDset.Next();
                    while (ds != null)
                    {
                        if (outName.ToLower() == ds.Name.ToLower() && (ds.Type == esriDatasetType.esriDTMosaicDataset || ds.Type == esriDatasetType.esriDTRasterDataset || ds.Type == esriDatasetType.esriDTRasterCatalog))
                        {
                            rsCheck = true;
                            break;
                        }
                        System.Runtime.InteropServices.Marshal.ReleaseComObject(ds);
                        ds = rsDset.Next();
                    }
                    System.Runtime.InteropServices.Marshal.ReleaseComObject(rsDset);
                    if (rsCheck)
                    {
                        rstDic[outName] = rsUtil.createIdentityRaster(outPath);
                        cmbRaster.Items.Add(outName);
                        cmbRaster.Text = outName;
                    }
                    else
                    {
                        ftrDic[outName] = geoUtil.getFeatureClass(outPath);
                        cmbRaster.Items.Add(outName);
                        cmbRaster.Text = outName;
                    }
                }
            }
            return;
        }
        private void getFeaturePath(Control cmb, ESRI.ArcGIS.Catalog.IGxObjectFilter flt)
        {
            string outPath = null;
            string outName = "";
            ESRI.ArcGIS.CatalogUI.IGxDialog gxDialog = new ESRI.ArcGIS.CatalogUI.GxDialogClass();
            gxDialog.AllowMultiSelect = false;
            gxDialog.ObjectFilter = flt;
            gxDialog.Title = "Select a Feature";
            ESRI.ArcGIS.Catalog.IEnumGxObject eGxObj;
            if (gxDialog.DoModalOpen(0, out eGxObj))
            {
                ESRI.ArcGIS.Catalog.IGxObject gxObj = eGxObj.Next();
                outPath = gxObj.FullName;
                outName = gxObj.BaseName;
                if (cmb.Name.ToLower() == "cmbraster")
                {
                    IRaster oRs = null;
                    if (!rstDic.ContainsKey(outName))
                    {
                        oRs = rsUtil.returnRaster(outPath);
                        rstDic.Add(outName, oRs );
                        cmbRaster.Items.Add(outName);
                    }
                    else
                    {
                        oRs = rsUtil.returnRaster(outPath);
                        rstDic[outName] = oRs;
                    }
                    object ndv = ((IRasterProps)((IRasterBandCollection)oRs).Item(0)).NoDataValue;
                    //txtNoData.Text = (ndv.ToString());
                }
                else
                {
                    outWks = geoUtil.OpenRasterWorkspace(outPath);
                }
                cmb.Text = outName;

            }
            return;
        }
示例#40
0
        private void getPath(bool isRaster)
        {
            string outPath = null;
            string outName = "";

            ESRI.ArcGIS.CatalogUI.IGxDialog gxDialog = new ESRI.ArcGIS.CatalogUI.GxDialogClass();
            gxDialog.AllowMultiSelect = false;
            ESRI.ArcGIS.Catalog.IGxObjectFilter flt = null;
            if (isRaster)
            {
                flt = new ESRI.ArcGIS.Catalog.GxFilterDatasetsClass();
            }
            else
            {
                flt = new ESRI.ArcGIS.Catalog.GxFilterFileGeodatabasesClass();
            }
            gxDialog.ObjectFilter = flt;
            gxDialog.Title        = "Select a Feature";
            ESRI.ArcGIS.Catalog.IEnumGxObject eGxObj;
            if (gxDialog.DoModalOpen(0, out eGxObj))
            {
                ESRI.ArcGIS.Catalog.IGxObject gxObj = eGxObj.Next();
                outPath = gxObj.FullName;
                outName = gxObj.BaseName;
                if (isRaster)
                {
                    string           wksPath    = geoUtil.getDatabasePath(outPath);
                    IWorkspace       wks        = geoUtil.OpenWorkSpace(wksPath);
                    IEnumDatasetName rsDsetName = wks.get_DatasetNames(esriDatasetType.esriDTRasterDataset);
                    bool             rsCheck    = false;
                    IDatasetName     dsName     = rsDsetName.Next();
                    while (dsName != null)
                    {
                        if (outName.ToLower() == dsName.Name.ToLower())
                        {
                            rsCheck = true;
                            break;
                        }
                        System.Runtime.InteropServices.Marshal.ReleaseComObject(dsName);
                        dsName = rsDsetName.Next();
                    }
                    System.Runtime.InteropServices.Marshal.ReleaseComObject(rsDsetName);
                    if (rsCheck)
                    {
                        if (!rstDic.ContainsKey(outName))
                        {
                            rstDic.Add(outName, rsUtil.createIdentityRaster(outPath));
                            cmbRst.Items.Add(outName);
                        }
                        else
                        {
                            rstDic[outName] = rsUtil.createIdentityRaster(outPath);
                        }
                    }
                    else
                    {
                        ftrDic[outName] = geoUtil.getFeatureClass(outPath);
                    }
                    cmbRst.Text = outName;
                }
                else
                {
                    txtOutWorkspace.Text = outPath;
                }
            }
            return;
        }
        private void getFeaturePath(object sender, EventArgs e)
        {
            Control cnt = (Control)sender;
            string cntName = cnt.Name;
            TextBox txtBox = txtPop;
            if (cntName == btnSamp.Name) txtBox = txtSamp;
            string outPath = null;
            string outName = "";
            ESRI.ArcGIS.CatalogUI.IGxDialog gxDialog = new ESRI.ArcGIS.CatalogUI.GxDialogClass();
            gxDialog.AllowMultiSelect = false;
            ESRI.ArcGIS.Catalog.IGxObjectFilter flt = null;
            flt = new ESRI.ArcGIS.Catalog.GxFilterTablesAndFeatureClassesClass();
            gxDialog.ObjectFilter = flt;
            gxDialog.Title = "Select a Feature Class or Table";
            ESRI.ArcGIS.Catalog.IEnumGxObject eGxObj;
            if (gxDialog.DoModalOpen(0, out eGxObj))
            {
                ESRI.ArcGIS.Catalog.IGxObject gxObj = eGxObj.Next();
                outPath = gxObj.FullName;
                outName = gxObj.BaseName;
                IRaster rs = rsUtil.returnRaster(outPath);
                if (rs == null)
                {
                    if (!ftrDic.ContainsKey(outName))
                    {
                        ftrDic.Add(outName, geoUtil.getTable(outPath));
                    }
                    else
                    {
                        ftrDic[outName] = geoUtil.getTable(outPath);
                    }

                }
                else
                {
                    if (!rstDic.ContainsKey(outName))
                    {
                        rstDic.Add(outName, rs);
                    }
                    else
                    {
                        rstDic[outName] = rs;
                    }
                }
                txtBox.Text = outName;
            }
            updateFieldComboBox();
            return;
        }
 private string getLocalDB()
 {
     string outPath = null;
     string outName = "";
     string outFullPath = null;
     ESRI.ArcGIS.CatalogUI.IGxDialog gxDialog = new ESRI.ArcGIS.CatalogUI.GxDialogClass();
     gxDialog.AllowMultiSelect = false;
     ESRI.ArcGIS.Catalog.IGxObjectFilter flt = null;
     flt = new ESRI.ArcGIS.Catalog.GxFilterFileGeodatabasesClass();
     gxDialog.ObjectFilter = flt;
     gxDialog.Title = "Select a GeoDatabase";
     ESRI.ArcGIS.Catalog.IEnumGxObject eGxObj;
     if (gxDialog.DoModalOpen(0, out eGxObj))
     {
         ESRI.ArcGIS.Catalog.IGxObject gxObj = eGxObj.Next();
         outPath = gxObj.FullName;
         outName = gxObj.BaseName;
         outFullPath = outPath;
     }
     return outFullPath;
 }
 private void getRasterOrFeaturePath()
 {
     string outPath = null;
     string outName = "";
     ESRI.ArcGIS.CatalogUI.IGxDialog gxDialog = new ESRI.ArcGIS.CatalogUI.GxDialogClass();
     ESRI.ArcGIS.Catalog.IGxObjectFilterCollection fltColl = (ESRI.ArcGIS.Catalog.IGxObjectFilterCollection)gxDialog;
     gxDialog.AllowMultiSelect = false;
     ESRI.ArcGIS.Catalog.IGxObjectFilter flt = new ESRI.ArcGIS.Catalog.GxFilterRasterDatasetsClass();
     ESRI.ArcGIS.Catalog.IGxObjectFilter flt2 = new ESRI.ArcGIS.Catalog.GxFilterPolygonFeatureClassesClass();
     fltColl.AddFilter(flt, true);
     fltColl.AddFilter(flt2, false);
     gxDialog.Title = "Select a Raster Polygon Dataset";
     ESRI.ArcGIS.Catalog.IEnumGxObject eGxObj;
     if (gxDialog.DoModalOpen(0, out eGxObj))
     {
         ESRI.ArcGIS.Catalog.IGxObject gxObj = eGxObj.Next();
         while (gxObj != null)
         {
             outPath = gxObj.FullName;
             outName = gxObj.BaseName;
             if (gxDialog.ObjectFilter is ESRI.ArcGIS.Catalog.GxFilterRasterDatasetsClass)
             {
                 IRaster rs = rsUtil.returnRaster(outPath);
                 if (!rstDic.ContainsKey(outName))
                 {
                     rstDic.Add(outName, rs);
                     cmbZoneRaster.Items.Add(outName);
                 }
                 else
                 {
                     rstDic[outName] = rs;
                 }
             }
             else
             {
                 IFeatureClass ftrCls = geoUtil.getFeatureClass(outPath);
                 if (!ftrDic.ContainsKey(outName))
                 {
                     ftrDic.Add(outName, ftrCls);
                     cmbZoneRaster.Items.Add(outName);
                 }
                 else
                 {
                     ftrDic[outName] = ftrCls;
                 }
             }
             gxObj = eGxObj.Next();
         }
         cmbZoneRaster.SelectedItem = outName;
     }
     return;
 }
        private void getFeaturePath()
        {
            string outPath = null;
            string outName = "";
            ESRI.ArcGIS.CatalogUI.IGxDialog gxDialog = new ESRI.ArcGIS.CatalogUI.GxDialogClass();
            gxDialog.AllowMultiSelect = true;
            ESRI.ArcGIS.Catalog.IGxObjectFilter flt = null;
            flt = new ESRI.ArcGIS.Catalog.GxFilterRasterDatasetsClass();
            gxDialog.ObjectFilter = flt;
            gxDialog.Title = "Select Rasters";
            ESRI.ArcGIS.Catalog.IEnumGxObject eGxObj;
            if (gxDialog.DoModalOpen(0, out eGxObj))
            {
                ESRI.ArcGIS.Catalog.IGxObject gxObj = eGxObj.Next();
                while (gxObj != null)
                {
                    outPath = gxObj.FullName;
                    outName = gxObj.BaseName;
                    IRaster rs = rsUtil.returnRaster(outPath);

                    if (!rstDic.ContainsKey(outName))
                    {
                        rstDic.Add(outName, rs);
                        lsbRaster.Items.Add(outName);
                        //cmbInRaster1.Items.Add(nNm);
                    }
                    else
                    {
                        rstDic[outName] = rs;
                    }
                    gxObj = eGxObj.Next();
                }
            }
            return;
        }
        private void getFeaturePathMap()
        {
            string outPath = null;
            string outName = "";
            ESRI.ArcGIS.CatalogUI.IGxDialog gxDialog = new ESRI.ArcGIS.CatalogUI.GxDialogClass();
            gxDialog.AllowMultiSelect = false;
            ESRI.ArcGIS.Catalog.IGxObjectFilter flt = null;
            flt = new ESRI.ArcGIS.Catalog.GxFilterGeoDatasetsClass();
            gxDialog.ObjectFilter = flt;
            gxDialog.Title = "Select a Feature or Raster Class";
            ESRI.ArcGIS.Catalog.IEnumGxObject eGxObj;
            if (gxDialog.DoModalOpen(0, out eGxObj))
            {
                ESRI.ArcGIS.Catalog.IGxObject gxObj = eGxObj.Next();
                outPath = gxObj.FullName;
                outName = gxObj.BaseName;
                IRaster rs = rsUtil.returnRaster(outPath);
                if (rs == null)
                {
                    if (!ftrDic.ContainsKey(outName))
                    {
                        ftrDic.Add(outName, geoUtil.getFeatureClass(outPath));
                        cmbMap.Items.Add(outName);
                    }
                    else
                    {
                        ftrDic[outName] = geoUtil.getFeatureClass(outPath);
                    }
                }
                else
                {
                    if (!rstDic.ContainsKey(outName))
                    {
                        rstDic.Add(outName, rsUtil.returnRaster(outPath));
                        cmbMap.Items.Add(outName);
                    }
                    else
                    {
                        rstDic[outName] = rsUtil.returnRaster(outPath);
                    }

                }
                cmbMap.SelectedItem = outName;
            }
            return;
        }
        private void btnOpenTable_Click(object sender, EventArgs e)
        {
            string outPath = null;
            string outName = "";
            ESRI.ArcGIS.CatalogUI.IGxDialog gxDialog = new ESRI.ArcGIS.CatalogUI.GxDialogClass();
            ESRI.ArcGIS.Catalog.IGxObjectFilterCollection fltColl = (ESRI.ArcGIS.Catalog.IGxObjectFilterCollection)gxDialog;
            gxDialog.AllowMultiSelect = false;
            ESRI.ArcGIS.Catalog.IGxObjectFilter flt2 = new ESRI.ArcGIS.Catalog.GxFilterTablesAndFeatureClassesClass();
            fltColl.AddFilter(flt2, false);
            gxDialog.Title = "Select a Table or Feature Class";
            ESRI.ArcGIS.Catalog.IEnumGxObject eGxObj;
            if (gxDialog.DoModalOpen(0, out eGxObj))
            {
                ESRI.ArcGIS.Catalog.IGxObject gxObj = eGxObj.Next();
                while (gxObj != null)
                {
                    outPath = gxObj.FullName;
                    outName = gxObj.BaseName;

                    ITable tbl = geoUtil.getTable(outPath);//need to check if this works for feature classes
                    if (!tblDic.ContainsKey(outName))
                    {
                        tblDic.Add(outName, tbl);
                        cmbTable.Items.Add(outName);
                    }
                    else
                    {
                        tblDic[outName] = tbl;
                    }

                    gxObj = eGxObj.Next();
                }
                cmbTable.SelectedItem = outName;
            }
            return;
        }
        private void btnOpenStands_Click(object sender, EventArgs e)
        {
            string outPath = null;
            string outName = "";
            ESRI.ArcGIS.CatalogUI.IGxDialog gxDialog = new ESRI.ArcGIS.CatalogUI.GxDialogClass();
            ESRI.ArcGIS.Catalog.IGxObjectFilterCollection fltColl = (ESRI.ArcGIS.Catalog.IGxObjectFilterCollection)gxDialog;
            gxDialog.AllowMultiSelect = false;
            ESRI.ArcGIS.Catalog.IGxObjectFilter flt2 = new ESRI.ArcGIS.Catalog.GxFilterPolygonFeatureClassesClass();
            fltColl.AddFilter(flt2, false);
            gxDialog.Title = "Select a Stands Feature Class";
            ESRI.ArcGIS.Catalog.IEnumGxObject eGxObj;
            if (gxDialog.DoModalOpen(0, out eGxObj))
            {
                ESRI.ArcGIS.Catalog.IGxObject gxObj = eGxObj.Next();
                while (gxObj != null)
                {
                    outPath = gxObj.FullName;
                    outName = gxObj.BaseName;

                    IFeatureClass ftrCls = geoUtil.getFeatureClass(outPath);
                    if (!ftrDic.ContainsKey(outName))
                    {
                        ftrDic.Add(outName, ftrCls);
                        cmbStands.Items.Add(outName);
                    }
                    else
                    {
                        ftrDic[outName] = ftrCls;
                    }

                    gxObj = eGxObj.Next();
                }
                cmbStands.SelectedItem = outName;
            }
            return;
        }
 private void btnGeoDb_Click(object sender, EventArgs e)
 {
     ESRI.ArcGIS.CatalogUI.IGxDialog gxDialog = new ESRI.ArcGIS.CatalogUI.GxDialogClass();
     gxDialog.AllowMultiSelect = false;
     ESRI.ArcGIS.Catalog.IGxObjectFilter flt = new ESRI.ArcGIS.Catalog.GxFilterFileGeodatabasesClass();
     gxDialog.ObjectFilter = flt;
     gxDialog.Title = "Select a File geodatabase to store tiles";
     ESRI.ArcGIS.Catalog.IEnumGxObject eGxObj;
     if (gxDialog.DoModalOpen(0, out eGxObj))
     {
         ESRI.ArcGIS.Catalog.IGxObject gxObj = eGxObj.Next();
         txtGeoDb.Text = gxObj.FullName;
     }
 }
 private void getLayer()
 {
     string outPath = null;
     string outName = "";
     ESRI.ArcGIS.CatalogUI.IGxDialog gxDialog = new ESRI.ArcGIS.CatalogUI.GxDialogClass();
     ESRI.ArcGIS.Catalog.IGxObjectFilterCollection fltColl = (ESRI.ArcGIS.Catalog.IGxObjectFilterCollection)gxDialog;
     gxDialog.AllowMultiSelect = true;
     ESRI.ArcGIS.Catalog.IGxObjectFilter flt = new ESRI.ArcGIS.Catalog.GxFilterRasterDatasetsClass();
     ESRI.ArcGIS.Catalog.IGxObjectFilter flt2 = new ESRI.ArcGIS.Catalog.GxFilterPolygonFeatureClassesClass();
     ESRI.ArcGIS.Catalog.IGxObjectFilter flt3 = new ESRI.ArcGIS.Catalog.GxFilterPointFeatureClassesClass();
     ESRI.ArcGIS.Catalog.IGxObjectFilter flt4 = new ESRI.ArcGIS.Catalog.GxFilterTablesClass();
     fltColl.AddFilter(flt, true);
     fltColl.AddFilter(flt2, false);
     fltColl.AddFilter(flt3, false);
     fltColl.AddFilter(flt4, false);
     gxDialog.Title = "Select a Raster, Polygon, Point, or Table";
     ESRI.ArcGIS.Catalog.IEnumGxObject eGxObj;
     if (gxDialog.DoModalOpen(0, out eGxObj))
     {
         ESRI.ArcGIS.Catalog.IGxObject gxObj = eGxObj.Next();
         while (gxObj != null)
         {
             outPath = gxObj.FullName;
             outName = gxObj.BaseName;
             if (gxDialog.ObjectFilter is ESRI.ArcGIS.Catalog.GxFilterRasterDatasetsClass)
             {
                 IFunctionRasterDataset rs = rsUtil.createIdentityRaster(outPath);
                 if (!rstDic.ContainsKey(outName))
                 {
                     rstDic.Add(outName, rs);
                 }
                 else
                 {
                     rstDic[outName] = rs;
                 }
             }
             else if (gxDialog.ObjectFilter is ESRI.ArcGIS.Catalog.GxFilterTablesClass)
             {
                 ITable tbl = geoUtil.getTable(outPath);
                 if (!tblDic.ContainsKey(outName))
                 {
                     tblDic.Add(outName, tbl);
                 }
                 else
                 {
                     tblDic[outName] = tbl;
                 }
             }
             else
             {
                 IFeatureClass ftrCls = geoUtil.getFeatureClass(outPath);
                 if (!ftrDic.ContainsKey(outName))
                 {
                     ftrDic.Add(outName, ftrCls);
                 }
                 else
                 {
                     ftrDic[outName] = ftrCls;
                 }
             }
             if (!lyrDic.ContainsKey(outName))
             {
                 lyrDic.Add(outName, outPath);
                 lsbLayers.Items.Add(outName);
             }
             else
             {
                 lyrDic[outName] = outPath;
             }
             gxObj = eGxObj.Next();
         }
     }
     return;
 }
        private void getFeaturePath()
        {
            string outPath = null;
            string outName = "";
            ESRI.ArcGIS.CatalogUI.IGxDialog gxDialog = new ESRI.ArcGIS.CatalogUI.GxDialogClass();
            gxDialog.AllowMultiSelect = false;
            ESRI.ArcGIS.Catalog.IGxObjectFilter flt = null;
            flt = new ESRI.ArcGIS.Catalog.GxFilterRasterDatasetsClass();
            gxDialog.ObjectFilter = flt;
            gxDialog.Title = "Select a Raster";
            ESRI.ArcGIS.Catalog.IEnumGxObject eGxObj;
            if (gxDialog.DoModalOpen(0, out eGxObj))
            {
                ESRI.ArcGIS.Catalog.IGxObject gxObj = eGxObj.Next();
                outPath = gxObj.FullName;
                outName = gxObj.BaseName;
                if (!rstDic.ContainsKey(outName))
                {
                    rstDic.Add(outName, rsUtil.returnRaster(outPath));
                    cmbInRaster1.Items.Add(outName);
                }
                else
                {
                    rstDic[outName] = rsUtil.returnRaster(outPath);
                }
                cmbInRaster1.Text = outName;

            }
            return;
        }
 private void getFeaturePath()
 {
     string outPath = null;
     string outName = "";
     ESRI.ArcGIS.CatalogUI.IGxDialog gxDialog = new ESRI.ArcGIS.CatalogUI.GxDialogClass();
     gxDialog.AllowMultiSelect = true;
     ESRI.ArcGIS.Catalog.IGxObjectFilter flt = null;
     flt = new ESRI.ArcGIS.Catalog.GxFilterRasterDatasetsClass();
     gxDialog.ObjectFilter = flt;
     ESRI.ArcGIS.Catalog.IGxObjectFilterCollection fltCol = (ESRI.ArcGIS.Catalog.IGxObjectFilterCollection)gxDialog;
     fltCol.AddFilter(new ESRI.ArcGIS.Catalog.GxFilterFilesClass(), false);
     fltCol.AddFilter(new ESRI.ArcGIS.Catalog.GxFilterTextFilesClass(), false);
     gxDialog.Title = "Select a Raster or net_Cdf";
     ESRI.ArcGIS.Catalog.IEnumGxObject eGxObj;
     if (gxDialog.DoModalOpen(0, out eGxObj))
     {
         ESRI.ArcGIS.Catalog.IGxObject gxObj = eGxObj.Next();
         while (gxObj != null)
         {
             outPath = gxObj.FullName;
             outName = gxObj.BaseName;
             if (!rstDic.ContainsKey(outName))
             {
                 rstDic.Add(outName, rsUtil.createIdentityRaster(outPath));
                 //cmbInRaster1.Items.Add(outName);
                 lsbRaster.Items.Add(outName);
             }
             else
             {
                 rstDic[outName] = rsUtil.createIdentityRaster(outPath);
             }
             gxObj = eGxObj.Next();
         }
         //cmbInRaster1.SelectedItem = outName;
     }
     return;
 }
示例#52
0
        private void getLayer()
        {
            string outPath = null;
            string outName = "";

            ESRI.ArcGIS.CatalogUI.IGxDialog gxDialog = new ESRI.ArcGIS.CatalogUI.GxDialogClass();
            ESRI.ArcGIS.Catalog.IGxObjectFilterCollection fltColl = (ESRI.ArcGIS.Catalog.IGxObjectFilterCollection)gxDialog;
            gxDialog.AllowMultiSelect = true;
            ESRI.ArcGIS.Catalog.IGxObjectFilter flt  = new ESRI.ArcGIS.Catalog.GxFilterRasterDatasetsClass();
            ESRI.ArcGIS.Catalog.IGxObjectFilter flt2 = new ESRI.ArcGIS.Catalog.GxFilterPolygonFeatureClassesClass();
            ESRI.ArcGIS.Catalog.IGxObjectFilter flt3 = new ESRI.ArcGIS.Catalog.GxFilterPointFeatureClassesClass();
            ESRI.ArcGIS.Catalog.IGxObjectFilter flt4 = new ESRI.ArcGIS.Catalog.GxFilterTablesClass();
            fltColl.AddFilter(flt, true);
            fltColl.AddFilter(flt2, false);
            fltColl.AddFilter(flt3, false);
            fltColl.AddFilter(flt4, false);
            gxDialog.Title = "Select a Raster, Polygon, Point, or Table";
            ESRI.ArcGIS.Catalog.IEnumGxObject eGxObj;
            if (gxDialog.DoModalOpen(0, out eGxObj))
            {
                ESRI.ArcGIS.Catalog.IGxObject gxObj = eGxObj.Next();
                while (gxObj != null)
                {
                    outPath = gxObj.FullName;
                    outName = gxObj.BaseName;
                    if (gxDialog.ObjectFilter is ESRI.ArcGIS.Catalog.GxFilterRasterDatasetsClass)
                    {
                        IFunctionRasterDataset rs = rsUtil.createIdentityRaster(outPath);
                        if (!rstDic.ContainsKey(outName))
                        {
                            rstDic.Add(outName, rs);
                        }
                        else
                        {
                            rstDic[outName] = rs;
                        }
                    }
                    else if (gxDialog.ObjectFilter is ESRI.ArcGIS.Catalog.GxFilterTablesClass)
                    {
                        ITable tbl = geoUtil.getTable(outPath);
                        if (!tblDic.ContainsKey(outName))
                        {
                            tblDic.Add(outName, tbl);
                        }
                        else
                        {
                            tblDic[outName] = tbl;
                        }
                    }
                    else
                    {
                        IFeatureClass ftrCls = geoUtil.getFeatureClass(outPath);
                        if (!ftrDic.ContainsKey(outName))
                        {
                            ftrDic.Add(outName, ftrCls);
                        }
                        else
                        {
                            ftrDic[outName] = ftrCls;
                        }
                    }
                    if (!lyrDic.ContainsKey(outName))
                    {
                        lyrDic.Add(outName, outPath);
                        lsbLayers.Items.Add(outName);
                    }
                    else
                    {
                        lyrDic[outName] = outPath;
                    }
                    gxObj = eGxObj.Next();
                }
            }
            return;
        }
        private void btnOpenTable_Click(object sender, EventArgs e)
        {
            ComboBox cmb = cmbStrata;
            if (((Button)sender).Name.ToLower().Contains("stands")) cmb = cmbStands;
            string outPath = null;
            string outName = "";
            ESRI.ArcGIS.CatalogUI.IGxDialog gxDialog = new ESRI.ArcGIS.CatalogUI.GxDialogClass();
            ESRI.ArcGIS.Catalog.IGxObjectFilterCollection fltColl = (ESRI.ArcGIS.Catalog.IGxObjectFilterCollection)gxDialog;
            gxDialog.AllowMultiSelect = false;
            ESRI.ArcGIS.Catalog.IGxObjectFilter flt2 = new ESRI.ArcGIS.Catalog.GxFilterPolygonFeatureClassesClass();
            fltColl.AddFilter(flt2, false);
            gxDialog.Title = "Select a Feature Class";
            ESRI.ArcGIS.Catalog.IEnumGxObject eGxObj;
            if (gxDialog.DoModalOpen(0, out eGxObj))
            {
                ESRI.ArcGIS.Catalog.IGxObject gxObj = eGxObj.Next();
                while (gxObj != null)
                {
                    outPath = gxObj.FullName;
                    outName = gxObj.BaseName;

                    IFeatureClass ftrCls = geoUtil.getFeatureClass(outPath);//need to check if this works for feature classes
                    if (!ftrDic.ContainsKey(outName))
                    {
                        ftrDic.Add(outName, ftrCls);
                        cmb.Items.Add(outName);
                    }
                    else
                    {
                        ftrDic[outName] = ftrCls;
                    }

                    gxObj = eGxObj.Next();
                }
                cmb.SelectedItem = outName;
            }
            return;
        }
 private void getFeaturePath()
 {
     string outPath = null;
     string outName = "";
     ESRI.ArcGIS.CatalogUI.IGxDialog gxDialog = new ESRI.ArcGIS.CatalogUI.GxDialogClass();
     gxDialog.AllowMultiSelect = true;
     ESRI.ArcGIS.Catalog.IGxObjectFilter flt = null;
     flt = new ESRI.ArcGIS.Catalog.GxFilterRasterDatasetsClass();
     gxDialog.ObjectFilter = flt;
     gxDialog.Title = "Select a Feature";
     ESRI.ArcGIS.Catalog.IEnumGxObject eGxObj;
     if (gxDialog.DoModalOpen(0, out eGxObj))
     {
         ESRI.ArcGIS.Catalog.IGxObject gxObj = eGxObj.Next();
         while (gxObj != null)
         {
             outPath = gxObj.FullName;
             outName = gxObj.BaseName;
             IRaster rs = rsUtil.returnRaster(outPath);
             if (((IRasterBandCollection)rs).Count > 1)
             {
                 IRasterBandCollection rsBc = (IRasterBandCollection)rs;
                 for (int r = 0; r < rsBc.Count; r++)
                 {
                     string nNm = outName + "_Band_" + (r + 1).ToString();
                     IRaster rsB = rsUtil.returnRaster(rsUtil.getBand(rs, r));
                     if (!rstDic.ContainsKey(nNm))
                     {
                         rstDic.Add(nNm, rsB);
                         //cmbInRaster1.Items.Add(nNm);
                         dgvRasterSlopes.Rows.Add(nNm, 0);
                     }
                     else
                     {
                         rstDic[nNm] = rsB;
                     }
                 }
             }
             else
             {
                 if (!rstDic.ContainsKey(outName))
                 {
                     rstDic.Add(outName, rs);
                     //cmbInRaster1.Items.Add(outName);
                     dgvRasterSlopes.Rows.Add(outName, 0);
                 }
                 else
                 {
                     rstDic[outName] = rs;
                 }
             }
             gxObj = eGxObj.Next();
         }
     }
     return;
 }
 private void getTablePath()
 {
     ESRI.ArcGIS.CatalogUI.IGxDialog gxDialog = new ESRI.ArcGIS.CatalogUI.GxDialogClass();
     gxDialog.AllowMultiSelect = false;
     ESRI.ArcGIS.Catalog.IGxObjectFilter flt = null;
     flt = new ESRI.ArcGIS.Catalog.GxFilterTablesClass();//.GxFilterRasterDatasetsClass();
     gxDialog.ObjectFilter = flt;
     gxDialog.Title = "Save Output Table";
     if (gxDialog.DoModalSave(0))
     {
         txtTableName.Text = gxDialog.FinalLocation.FullName + "\\" + gxDialog.Name;
     }
     return;
 }