private void btnOut_Click(object sender, EventArgs e) { ESRI.ArcGIS.Catalog.IGxObjectFilter flt = new ESRI.ArcGIS.Catalog.GxFilterFileGeodatabasesClass(); string[] nm; string wksPath = frmHlp.getPath(flt, out nm, false)[0]; txtOutWks.Text = wksPath; }
private void getWksPath() { ESRI.ArcGIS.Catalog.IGxObjectFilter flt = new ESRI.ArcGIS.Catalog.GxFilterFileGeodatabasesClass(); string[] namesArr; string[] pathArr = frmHlp.getPath(flt, out namesArr, false); string outPath = pathArr[0]; outWks = geoUtil.OpenWorkSpace(outPath); txtWorkspace.Text = namesArr[0]; 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 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 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 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 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; } }