private void btnOutFtrCls_Click(object sender, EventArgs e) { ESRI.ArcGIS.Catalog.IGxObjectFilter flt = new ESRI.ArcGIS.Catalog.GxFilterPolygonFeatureClassesClass(); string outName; txtOutFtrCls.Text = frmHlp.getPathSave(flt, out outName); }
private void btnROI_Click(object sender, EventArgs e) { ESRI.ArcGIS.Catalog.IGxObjectFilter flt = new ESRI.ArcGIS.Catalog.GxFilterPolygonFeatureClassesClass(); ftrClsPath = frmHelper.getPath(flt, out ftrClsName)[0]; frmHelper.FeatureDictionary[ftrClsName[0]] = geoUtil.getFeatureClass(ftrClsPath); cmbROI.Items.Add(ftrClsName[0]); cmbROI.SelectedItem = ftrClsName[0]; }
private void btnFtrCls_Click(object sender, EventArgs e) { ESRI.ArcGIS.Catalog.IGxObjectFilter flt = new ESRI.ArcGIS.Catalog.GxFilterPolygonFeatureClassesClass(); string[] nm; string ftrPath = frmHlp.getPath(flt, out nm, false)[0]; ftrDic[nm[0]] = geoUtil.getFeatureClass(ftrPath); cmbFtrCls.Items.Add(nm); cmbFtrCls.SelectedItem = nm; }
private void button1_Click(object sender, EventArgs e) { ESRI.ArcGIS.Catalog.IGxObjectFilter flt = new ESRI.ArcGIS.Catalog.GxFilterPolygonFeatureClassesClass(); string[] outName; string outPath = frmHlp.getPath(flt, out outName, false)[0]; frmHlp.FeatureDictionary[outName[0]] = geoUtil.getFeatureClass(outPath); cmbFtrCls.Items.Add(outName[0]); cmbFtrCls.SelectedItem = outName[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; }
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 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 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 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 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 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 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; } }