Example #1
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;
        }
Example #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;
        }
Example #3
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;
        }
Example #4
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;
        }
Example #5
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;
        }
Example #6
0
        private string getRaster()
        {
            string[] nm;
            ESRI.ArcGIS.Catalog.IGxObjectFilter flt = new ESRI.ArcGIS.Catalog.GxFilterRasterDatasetsClass();
            string rstPath = frmHlp.getPath(flt, out nm, false)[0];

            frmHlp.FunctionRasterDictionary[nm[0]] = rsUtil.createIdentityRaster(rstPath);
            return(nm[0]);
        }
Example #7
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;
        }
Example #8
0
        private void getFeaturePath()
        {
            ESRI.ArcGIS.Catalog.IGxObjectFilter flt = new ESRI.ArcGIS.Catalog.GxFilterRasterDatasetsClass();
            string[] nm;
            string   outPath = frmHlp.getPath(flt, out nm, false)[0];
            string   outName = nm[0];

            frmHlp.FunctionRasterDictionary[outName] = rsUtil.createIdentityRaster(outPath);
            cmbInRaster1.Text = outName;
            return;
        }
Example #9
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;
        }
Example #10
0
 private void getFeaturePath()
 {
     ESRI.ArcGIS.Catalog.IGxObjectFilter flt = new ESRI.ArcGIS.Catalog.GxFilterRasterDatasetsClass();
     string[] rsNames;
     string[] rsPaths = frmHlp.getPath(flt, out rsNames, true);
     for (int i = 0; i < rsPaths.Length; i++)
     {
         string pt = rsPaths[i];
         string nm = rsNames[i];
         rstDic[nm] = pt;
         lsbRaster.Items.Add(nm);
     }
     return;
 }
Example #11
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);
        }
        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 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 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 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;
 }
 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 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 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 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 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 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;
 }
 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;
 }
Example #23
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;
        }