地形圖標(biāo)準(zhǔn)分幅_第1頁(yè)
地形圖標(biāo)準(zhǔn)分幅_第2頁(yè)
地形圖標(biāo)準(zhǔn)分幅_第3頁(yè)
全文預(yù)覽已結(jié)束

下載本文檔

版權(quán)說(shuō)明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)

文檔簡(jiǎn)介

1、public enum ScaleMark A, B, C, D, E, F, G, H ;/不同比例尺的號(hào)碼 private int m_1s1000000_row;/1:100萬(wàn)圖幅行 private int m_1s1000000_list;/1:100萬(wàn)圖幅列 private int m_assign_row;/指定比例尺圖幅行 private int m_assign_list;/指定比例尺圖幅列 private int m_scale;/指定比例尺; private FrmGeocodingExport pFGE; private esriUnits m_CurMapUnits;

2、#region 圖幅號(hào)計(jì)算函數(shù) private IEnvelope FromGeocodingDawn() /計(jì)算要素的值 int h = this.m_1s1000000_row ;/1:100萬(wàn)行號(hào) int l = this.m_1s1000000_list ;/1:100萬(wàn)列號(hào) ScaleMark ScaleMark_1s1000000 = new ScaleMark(); IPoint scaleDelta_1s1000000 = new PointClass(); ScaleMark_1s1000000 = 0; this.initialScaleMark(ScaleMark_1s1

3、000000, scaleDelta_1s1000000); double delta_x = scaleDelta_1s1000000.X;/1:100萬(wàn)經(jīng)差(度) double delta_y = scaleDelta_1s1000000.Y;/1:100萬(wàn)緯差(度) ScaleMark pScaleMark = new ScaleMark(); IPoint scaleDelta = new PointClass(); pScaleMark = (ScaleMark )m_scale ; this.initialScaleMark(pScaleMark , scaleDelta); do

4、uble delta_xp = scaleDelta.X;/1:10萬(wàn)經(jīng)差(度) double delta_yp = scaleDelta.Y;/1:10萬(wàn)緯差(度) int hp = m_assign_row; int lp = m_assign_list; IEnvelope pEnvelope = new EnvelopeClass(); if (m_assign_list != 0 && m_assign_row != 0) /進(jìn)行指定圖幅號(hào)左上角點(diǎn)經(jīng)緯度計(jì)算 double ymax = h * delta_y - (hp - 1) * delta_yp; /緯度 do

5、uble xmin = (l - 31) * delta_x + (lp - 1) * delta_xp;/經(jīng)度 /推算指定圖幅號(hào)右下角點(diǎn)坐標(biāo) double ymin = ymax - delta_yp; double xmax = xmin + delta_xp; /將點(diǎn)轉(zhuǎn)換成地圖存儲(chǔ)單位Map(Metres) convertUnits /esriUnits CurMapUnits = this.axMapControl1.Map.MapUnits; IUnitConverter UC_map = new UnitConverterClass(); double yMax = UC_map.

6、ConvertUnits(ymax, esriUnits.esriDecimalDegrees, m_CurMapUnits); double yMin = UC_map.ConvertUnits(ymin, esriUnits.esriDecimalDegrees, m_CurMapUnits); double xMax = UC_map.ConvertUnits(xmax, esriUnits.esriDecimalDegrees, m_CurMapUnits); double xMin = UC_map.ConvertUnits(xmin, esriUnits.esriDecimalDe

7、grees, m_CurMapUnits); pEnvelope.PutCoords(xMin, yMin, xMax, yMax); return pEnvelope; else return null; #endregion #region /各比例尺經(jīng)緯度差 private void initialScaleMark(ScaleMark pScaleMark, IPoint scaleDelta) /IPoint scaleArr = new IPoint8; /IPoint scaleDelta = new PointClass(); switch (pScaleMark) case

8、ScaleMark.A: scaleDelta.X = 6;/1:100萬(wàn)經(jīng)差(度) scaleDelta.Y = 4;/1:100萬(wàn)緯差(度) break; case ScaleMark.B: scaleDelta.X = 3;/1:50萬(wàn)經(jīng)差(度) scaleDelta.Y = 2;/1:50萬(wàn)緯差(度) break; case ScaleMark.C: scaleDelta.X = 1.5;/1:25萬(wàn)經(jīng)差(度) scaleDelta.Y = 1;/1:25萬(wàn)緯差(度) break; case ScaleMark.D: scaleDelta.X = 0.5;/1:10萬(wàn)經(jīng)差(度) sca

9、leDelta.Y = 0.33333;/1:10萬(wàn)緯差(度) break; case ScaleMark.E: scaleDelta.X = 0.25;/1:5萬(wàn)經(jīng)差(度) scaleDelta.Y = 0.16667;/1:5萬(wàn)緯差(度) break; case ScaleMark.F: scaleDelta.X = 0.125;/1:2.5萬(wàn)經(jīng)差(度) scaleDelta.Y = 0.08333;/1:2.5萬(wàn)緯差(度) break; case ScaleMark.G: scaleDelta.X = 0.0625;/1:1萬(wàn)經(jīng)差(度) scaleDelta.Y = 0.04167;/1

10、:1萬(wàn)緯差(度) break; case ScaleMark.H: scaleDelta.X = 0.03125;/1:5000經(jīng)差(度) scaleDelta.Y = 0.02083;/1:5000緯差(度) break; #endregion #region /調(diào)整elements里面的顯示框標(biāo)準(zhǔn)(因?yàn)槲矣昧薃E中pagelayout的模板,所以要把MapFrame調(diào)整到圖幅框的縮放比例) public void AdjustMapFrameInPageLayout(IMapFrame pMapFrame, IEnvelope pMapControlEnv) /調(diào)整elements里面的顯

11、示框標(biāo)準(zhǔn) /IMapFrame pMapFrame = (IActiveView)this.axPageLayoutControl1.PageLayout).GraphicsContainer.FindFrame(this.axPageLayoutControl1.ActiveView.FocusMap) as IMapFrame; IElement pElement = pMapFrame as IElement; /獲取當(dāng)前mapFrame的中心點(diǎn)坐標(biāo); IEnvelope MainEnv = pElement.Geometry.Envelope; pElement.QueryBounds

12、(this.axPageLayoutControl1.ActiveView.ScreenDisplay, MainEnv); IPoint pCenterPoint = new PointClass();/MapFrame中心點(diǎn)坐標(biāo) pCenterPoint.X = MainEnv.XMax - MainEnv.Width / 2; pCenterPoint.Y = MainEnv.YMax - MainEnv.Height / 2; /根據(jù)當(dāng)前MapFrame的標(biāo)準(zhǔn)和pEnvelope的比例關(guān)系決定更改后的MapFrame長(zhǎng)寬度 double ratio = pMapControlEnv.H

13、eight / pMapControlEnv.Wi dth; double CurMapFrameRatio = MainEnv.Height / MainEnv.Width; /IEnvelope pageEnvelope = this.axPageLayoutControl1.PageLayout.Page.PrintableBounds; double dDataFrameWidth, dDataFrameHeight; double scale; if (ratio >= CurMapFrameRatio) dDataFrameHeight = MainEnv.Height; d

14、DataFrameWidth = dDataFrameHeight / ratio; else dDataFrameWidth = MainEnv.Width;/地圖MapFrame應(yīng)該的寬度 dDataFrameHeight = dDataFrameWidth * ratio;/地圖MapFrame應(yīng)該的高度 IElement tempElement = pMapFrame as IElement; tempElement.Geometry = pMapControlEnv; ITransform2D pTransform2d = (ITransform2D)tempElement; IPo

15、int pFrameCenter = new PointClass(); pFrameCenter.X = pMapControlEnv.XMax - pMapControlEnv.Width / 2; pFrameCenter.Y = pMapControlEnv.YMax - pMapControlEnv.Height / 2; scale = dDataFrameWidth / pMapControlEnv.Width;/縮放比例 double dx = pCenterPoint.X - pFrameCenter.X; double dy = pCenterPoint.Y - pFram

16、eCenter.Y; pTransform2d.Move(dx, dy);/移動(dòng)到指定位置 pTransform2d.Scale(pCenterPoint, scale, scale);/將MapFrame圖形縮放 #endregion /最后圖幅加載到pagelayout中顯示,是單擊按鈕事件哦 private void bt_contain_Click(object sender, EventArgs e) try this.splitCodeValue(); this.pFGE.axPageLayoutControl1.LoadMxFile(pFGE.filename, "&q

17、uot;); /生成指定圖幅號(hào)圖幅兩個(gè)對(duì)角點(diǎn)的坐標(biāo) IEnvelope FromGeocodingDawn(string geocoding) /double xMin = 555000; /double yMin = 2898000; /double xMax = 560000; /double yMax = 2904000; /確定一個(gè)矩形 IEnvelope pEnvelope = new EnvelopeClass(); pEnvelope = this.FromGeocodingDawn();/.PutCoords(xMin, yMin, xMax, yMax); /用此矩形切底圖,

18、并加載到pagelayoutcontrol中顯示 IActiveView pActiveView = pFGE.axMapControl1.ActiveView.FocusMap as IActiveView; pFGE.axMapControl1.ActiveView.Extent = pEnvelope; IActiveView activeView = pFGE.axPageLayoutControl1.ActiveView.FocusMap as IActiveView; IDisplayTransformation DT = new DisplayTransformationClass(); DT = activeView.ScreenDisplay.DisplayTransformation; DT.VisibleBounds = pEnvelope; activeView.Refresh(); /調(diào)整el

溫馨提示

  • 1. 本站所有資源如無(wú)特殊說(shuō)明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁(yè)內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒(méi)有圖紙預(yù)覽就沒(méi)有圖紙。
  • 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
  • 5. 人人文庫(kù)網(wǎng)僅提供信息存儲(chǔ)空間,僅對(duì)用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
  • 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。