將座標系統儲存為一個檔案.prj

GIS程式猿發表於2018-09-13
            try
            {
                System.Windows.Forms.SaveFileDialog m_SaveFileDialog = new System.Windows.Forms.SaveFileDialog();
                m_SaveFileDialog.Filter = "座標系統檔案(*.Prj)|*.Prj";
                if (System.Windows.Forms.DialogResult.OK == m_SaveFileDialog.ShowDialog())
                {
                    string sFilepath = m_SaveFileDialog.FileName;
                    if (m_pSpaRefFac == null)
                    {
                        m_pSpaRefFac = new SpatialReferenceEnvironmentClass();
                    }
                    m_pSpaRefFac.ExportESRISpatialReferenceToPRJFile(sFilepath, m_pSpatialRef);
                }
            }
            catch(Exception ex)
            {
                Log4net.Models.LogService.WriteExceptionLog(ex, "");
            }

private ISpatialReference m_pSpatialRef;

相關文章