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; }
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(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 void getCov() { if (varcovpath != null) { varCov = new dataPrepVarCovCorr(); varCov.buildModel(varcovpath); if (intable == null && inraster == null) { VariableFieldNames = varCov.VariableFieldNames; inpath = varCov.InPath; intable = geoUtil.getTable(inpath); if (intable == null) { inraster = rsUtil.returnRaster(inpath); } } } else { if (InRaster == null) { varCov = new dataPrepVarCovCorr(InTable, VariableFieldNames); } else { varCov = new dataPrepVarCovCorr(InRaster); } } meanVector = varCov.MeanVector; stdVector = varCov.StdVector; corr = varCov.CorralationMatrix; n = varCov.N; }
private void btnOpenTable_Click(object sender, EventArgs e) { ComboBox cmb = cmbParent; if (((Button)sender).Name.ToLower().Contains("child")) { cmb = cmbChild; } 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); cmb.Items.Add(outName); } else { tblDic[outName] = tbl; } gxObj = eGxObj.Next(); } cmb.SelectedItem = outName; } return; }
/// <summary> /// adds a layer to the active view /// </summary> /// <param name="path">full path name</param> /// <returns>Ilayer</returns> public ILayer addLayer(string path) { IMap map = (IMap)acView; geoDatabaseUtility geoUtil = new geoDatabaseUtility(); esriDatasetType dType = geoUtil.getDataType(path); ILayer lyr = null; switch (dType) { case esriDatasetType.esriDTFeatureClass: IFeatureLayer ftrLayer = new FeatureLayerClass(); ftrLayer.FeatureClass = geoUtil.getFeatureClass(path); lyr = (ILayer)ftrLayer; lyr.Name = ftrLayer.FeatureClass.AliasName; map.AddLayer(lyr); break; case esriDatasetType.esriDTRasterBand: case esriDatasetType.esriDTRasterCatalog: case esriDatasetType.esriDTRasterDataset: IRasterLayer rasterLayer = new RasterLayerClass(); rasterLayer.CreateFromDataset(geoUtil.getRasterDataset(path)); rasterLayer.Name = rasterLayer.Name; map.AddLayer((ILayer)rasterLayer); break; case esriDatasetType.esriDTTable: ITable tbl = geoUtil.getTable(path); ITableCollection tableCollection = (ITableCollection)map; tableCollection.AddTable(tbl); break; default: break; } acView.Refresh(); return(lyr); }
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; }