private void btnChooseCoordination_Click(object sender, EventArgs e) { ISpatialReferenceDialog2 pSRDialog = new SpatialReferenceDialogClass(); outSpatialReference = pSRDialog.DoModalCreate(true, false, false, 0); string strSRName = outSpatialReference.Name; txbxOutputCoordination.Text = strSRName; }
private void btnImport_Click(object sender, EventArgs e) { ISpatialReferenceDialog2 pSpatialReferenceDialog2 = new SpatialReferenceDialogClass(); _spatialReference = pSpatialReferenceDialog2.DoModalCreate(true, true, true, 0); if (_spatialReference == null) { return; } IWorkspaceEdit pWorkspaceEdit = _targetWorkspace as IWorkspaceEdit; if (pWorkspaceEdit == null) { return; } pWorkspaceEdit.StartEditing(true); pWorkspaceEdit.StartEditOperation(); try { _pointList = new List <CustomPoint>(); _pointFeatureClassList = new List <CustomFeatureClass>(); _lineFeatureClassList = new List <CustomFeatureClass>(); if (chkHasCoordInfo.Checked == false) { GetSurveyPointList(); } ExcelToPointFeatureClass(); ExcelToLineFeatureClass(); foreach (CustomFeatureClass customFeatureClass in _pointFeatureClassList) { WorkspaceHelper.LoadFeatureClass(_map, customFeatureClass.FeatureClass); } foreach (CustomFeatureClass customFeatureClass in _lineFeatureClassList) { WorkspaceHelper.LoadFeatureClass(_map, customFeatureClass.FeatureClass); } } catch (Exception exception) { MessageBox.Show(exception.Message); } finally { pWorkspaceEdit.StopEditOperation(); pWorkspaceEdit.StopEditing(true); foreach (Process p in Process.GetProcessesByName("Excel")) { if (string.IsNullOrEmpty(p.MainWindowTitle)) { p.Kill(); } } } }
//选择坐标系 private void button2_Click(object sender, EventArgs e) { ISpatialReferenceDialog2 spatialReferenceDialog2 = new SpatialReferenceDialogClass(); pSpatialReference = spatialReferenceDialog2.DoModalCreate(true, false, false, 0); if (pSpatialReference == null) { return; } textBox2.Text = pSpatialReference.Name; }
private void SpatialRSelect_Click(object sender, EventArgs e) { ISpatialReferenceDialog2 pSRDialog = new SpatialReferenceDialogClass(); ISpatialReference iSpatialReference = pSRDialog.DoModalCreate(true, false, false, 0); if (iSpatialReference != null) { this.textBox1.Text = iSpatialReference.Name; CommonClass common = new CommonClass(); common.SetConfigValue("SpatialReferenceName", iSpatialReference.Name); } }
private void btnSpatialRef_Click(object sender, EventArgs e) { if (m_pGXObj == null) { MessageBox.Show("Please select a FeatureLayer first"); return; } ISpatialReferenceDialog pSpatRefDialog = new SpatialReferenceDialogClass(); m_pSpatRef = pSpatRefDialog.DoModalCreate(false, false, false, 0); txtSpatialRef.Text = m_pSpatRef.Name.ToString(); this.Focus(); }
/// <summary> /// Allows the user to choose a custom output projection. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void buttonSR_Click(object sender, EventArgs e) { ISpatialReferenceDialog2 dlg = new SpatialReferenceDialogClass(); ISpatialReference sr = dlg.DoModalCreate(false, false, false, 0); labelSR.Text = sr.Name; _transform.SetSpatialReference(sr); if (sr != null) { _map.SpatialReference = sr; ArcMap.Document.ActiveView.Refresh(); } FillDatumTransform(); EnableSelectInputs(); }