⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 使用arcgis engine 开发自定义gis应用--第六部分(续实例二) - gis大讲堂.htm

📁 使用ArcGIS Engine 开发自定义GIS应用
💻 HTM
📖 第 1 页 / 共 5 页
字号:
            href="http://bbs.esrichina-bj.cn/ESRI/viewthread.php?tid=5193&extra=page%3D1" 
            target=_blank>恭喜社区单日发帖接近500,查看详情! 
  </A></TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE></DIV>
<DIV class=spaceborder style="MARGIN-BOTTOM: 4px; WIDTH: 98%">
<TABLE class=t_row cellSpacing=0 cellPadding=4 width="100%" align=center>
  <TBODY>
  <TR style="HEIGHT: 100%">
    <TD class=t_user vAlign=top width="18%"><A class=bold 
      href="http://bbs.esrichina-bj.cn/ESRI/viewpro.php?uid=5624" 
      target=_blank>北斗星</A> <SPAN class=smalltxt>(北斗星)</SPAN> <BR>
      <DIV class=smalltxt>超级版主<BR><IMG alt="Rank: 8" 
      src="使用ArcGIS Engine 开发自定义GIS应用--第六部分(续实例二) - GIS大讲堂.files/star_level3.gif"><IMG 
      alt="Rank: 8" 
      src="使用ArcGIS Engine 开发自定义GIS应用--第六部分(续实例二) - GIS大讲堂.files/star_level3.gif"><BR><BR>
      <TABLE style="TABLE-LAYOUT: fixed; OVERFLOW: hidden" cellSpacing=0 
      cellPadding=0 width="95%" border=0>
        <TBODY>
        <TR>
          <TD align=middle>
            <DIV class=avatar style="WIDTH: 120px"><IMG height=89 alt="" 
            src="使用ArcGIS Engine 开发自定义GIS应用--第六部分(续实例二) - GIS大讲堂.files/5624.jpg" 
            width=120 border=0></DIV></TD></TR></TBODY></TABLE><BR><IMG alt=优秀讲师勋章 
      src="使用ArcGIS Engine 开发自定义GIS应用--第六部分(续实例二) - GIS大讲堂.files/medal9.gif" 
      border=0> &nbsp; <IMG alt=优秀版主勋章 
      src="使用ArcGIS Engine 开发自定义GIS应用--第六部分(续实例二) - GIS大讲堂.files/medal2.gif" 
      border=0> &nbsp; <BR>UID 5624<BR>精华 <A 
      href="http://bbs.esrichina-bj.cn/ESRI/digest.php?authorid=5624">10</A> 
      <BR>积分 3658<BR>帖子 1602<BR>金钱 3158 <BR>威望 50 <BR>阅读权限 201<BR>注册 
      2006-11-1<BR>状态 离线 </DIV></TD>
    <TD 
    style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; PADDING-BOTTOM: 0px; PADDING-TOP: 0px" 
    vAlign=top width="82%">
      <TABLE class=t_msg cellSpacing=0 cellPadding=4 border=0>
        <TBODY>
        <TR>
          <TD>
            <DIV>
            <DIV class="right t_number"><A class=bold 
            onclick="window.clipboardData.setData('text','http://bbs.esrichina-bj.cn/ESRI/viewthread.php?tid=6656&amp;page=1#pid33845')" 
            href="http://bbs.esrichina-bj.cn/ESRI/viewthread.php?tid=6656&amp;extra=page%3D1###">#2</A></DIV>
            <DIV style="PADDING-TOP: 4px">发表于 2007-3-13 11:22 PM&nbsp; <A 
            href="http://bbs.esrichina-bj.cn/ESRI/viewpro.php?uid=5624">资料</A> 
            <A href="http://bbs.esrichina-bj.cn/ESRI/blog.php?uid=5624" 
            target=_blank>文集</A> <A 
            href="http://bbs.esrichina-bj.cn/ESRI/pm.php?action=send&amp;uid=5624" 
            target=_blank>短消息</A>&nbsp; </DIV></DIV></TD></TR>
        <TR>
          <TD class=line style="PADDING-TOP: 10px" vAlign=top height="100%"><A 
            title="评分 0" 
            href="http://bbs.esrichina-bj.cn/ESRI/misc.php?action=viewratings&amp;tid=6656&amp;pid=33845" 
            name=pid33845></A><SPAN class=bold>回复 #1 北斗星 的帖子</SPAN><BR><BR>
            <DIV style="FONT-SIZE: 12px"><B><FONT 
            size=3>第二步:增加功能来导入.lyr文件及.MXD文件<BR>在这节里你将增加一个功能来导入图层和地图文档,这些图层是基于2D文件格式并且导入到3D控件中。<BR>1)&nbsp; 
            &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;Open the frm3DControls.vb code 
            window.<BR>2)&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;From the left 
            dropdown list, click btnLoadlyrmxd events.<BR>3)&nbsp; &nbsp;&nbsp; 
            &nbsp;&nbsp;&nbsp;From the right dropdown list, click Click.NOTE: 
            Alternatively, you can double-click the control.<BR>4)&nbsp; 
            &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;In the btnLoadlyrmxd_Click event 
            procedure, add the following code:</FONT></B><BR>Private Sub 
            btnLoadlyrmxd_Click(ByVal sender As System.Object, ByVal e As 
            System.EventArgs) Handles btnLoadlyrmxd.Click<BR>&nbsp; &nbsp;&nbsp; 
            &nbsp;&nbsp;&nbsp;' Open a file dialog for selecting map 
            documents<BR>&nbsp; &nbsp;&nbsp; 
            &nbsp;&nbsp;&nbsp;OpenFileDialog1.Title = "Add Data"<BR>&nbsp; 
            &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;OpenFileDialog1.Filter = "Layer Files 
            (*.lyr)|*.lyr|Map Documents"<BR>(*.mxd)|*.mxd"<BR>&nbsp; 
            &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;OpenFileDialog1.InitialDirectory = 
            "c:\student\daae\data\"<BR>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;If 
            (OpenFileDialog1.ShowDialog() &lt;&gt; DialogResult.OK) Then Exit 
            Sub<BR>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;Dim sFilePath As 
            String<BR>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;sFilePath = 
            OpenFileDialog1.FileName<BR>&nbsp; &nbsp;&nbsp; 
            &nbsp;&nbsp;&nbsp;Dim mapDocument As IMapDocument<BR>&nbsp; 
            &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;mapDocument = New 
            MapDocument<BR>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;If (Not 
            mapDocument.IsMapDocument(sFilePath)) Then Exit Sub<BR>&nbsp; 
            &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;mapDocument.Open(sFilePath)<BR>&nbsp; 
            &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;Dim scene As IScene<BR>&nbsp; 
            &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;If TabControl1.SelectedTab Is 
            tbpgSceneCtrl Then<BR>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; 
            &nbsp;'Scene<BR>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; 
            &nbsp;scene = AxSceneControl1.Scene<BR>&nbsp; &nbsp;&nbsp; 
            &nbsp;&nbsp; &nbsp;&nbsp; 
            &nbsp;scene.AddLayers(mapDocument.Map(0).Layers, False)<BR>&nbsp; 
            &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;ElseIf TabControl1.SelectedTab Is 
            tbpgGlobeCtrl Then<BR>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; 
            &nbsp;'Globe<BR>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; 
            &nbsp;scene = AxGlobeControl1.GlobeDisplay.Scene<BR>&nbsp; 
            &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; 
            &nbsp;scene.AddLayers(mapDocument.Map(0).Layers, False)<BR>&nbsp; 
            &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;End If<BR>&nbsp; &nbsp;&nbsp; 
            &nbsp;&nbsp;&nbsp;Me.Text = "3D Controls - " &amp; sFilePath<BR>End 
            Sub<BR><B><FONT size=3>5)&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;Save 
            and build the solution.<BR>6)&nbsp; &nbsp;&nbsp; 
            &nbsp;&nbsp;&nbsp;Run the application.<BR>7)&nbsp; &nbsp;&nbsp; 
            &nbsp;&nbsp;&nbsp;Click the Scene tab.<BR>8)&nbsp; &nbsp;&nbsp; 
            &nbsp;&nbsp;&nbsp;Click the Load lyr/mxd button. From the 
            \student\daae\data\SceneData\ directory,<BR>9)&nbsp; &nbsp;&nbsp; 
            &nbsp;&nbsp;&nbsp;load the Death Valley Terrain.lyr.<BR>10)&nbsp; 
            &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;Click the Globe tab.<BR>11)&nbsp; 
            &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;Click the Load lyr/mxd button. From 
            the \student\daae\data\GlobeData\ directory,load the 
            Countries.lyr.<BR></FONT></B><BR><B><FONT 
            size=3>第三步:在SCENECONTROL控件中加入栅格图层<BR>通过SceneControl的一些属性及方法你将增加栅格影像到你的三维系统中。<BR>1)&nbsp; 
            &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;Open the frm3DControls.vb code 
            window.<BR>2)&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;In the 
            frm3DControls.vb window, from the left dropdown list, 
            click btnAddRasterLayer.<BR>3)&nbsp; &nbsp;&nbsp; 
            &nbsp;&nbsp;&nbsp;From the right dropdown list, click 
            Click.<BR>a)&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;NOTE: 
            Alternatively, you can double-click the control.<BR>4)&nbsp; 
            &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;Add the following code to the 
            btnAddRasterLayer_Click event:<BR><BR></FONT></B>Private Sub 
            btnAddRasterLayer_Click(ByVal sender As System.Object, ByVal e 
            As<BR>System.EventArgs) Handles btnAddRasterLayer.Click<BR>Dim file, 
            filePath, fileName, fileExtension As String<BR>Dim layer As 
            ILayer<BR>Dim WSFact As IWorkspaceFactory<BR>Dim RasterWorkspace As 
            IRasterWorkspace<BR>Dim RasterDataset As IRasterDataset<BR>Dim 
            Rasterlayer As IRasterLayer<BR>'Open a file dialog to add 
            data<BR>OpenFileDialog1.Filter = "Raster Files (*.tif)|*.tif|All 
            files (*.*)|*.*"<BR>If (OpenFileDialog1.ShowDialog() &lt;&gt; 
            DialogResult.OK) Then Exit Sub<BR>file = 
            OpenFileDialog1.FileName<BR>Try<BR>filePath = file.Substring(0, 
            file.LastIndexOf("\"))<BR>fileName = 
            file.Substring(file.LastIndexOf("\") + 1)<BR>fileExtension = 
            file.Substring(file.LastIndexOf(".") + 1).ToLower<BR>WSFact = New 
            RasterWorkspaceFactory<BR>RasterWorkspace = 
            WSFact.OpenFromFile(filePath, 0)<BR>RasterDataset = 
            RasterWorkspace.OpenRasterDataset(fileName)<BR>Rasterlayer = New 
            RasterLayer<BR>Rasterlayer.CreateFromDataset(RasterDataset)<BR>layer 
            = Rasterlayer<BR>m_scene.AddLayer(layer)<BR>Catch ex As 
            Exception<BR>MsgBox(file + " " + ex.Message)<BR>End 
            Try<BR>Functions.AddLayerToList(lstLayers, 
            Functions.GetSceneLayers(m_scene))<BR>End Sub<BR><B><FONT 
            size=3>5)&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;Save and build the 
            solution.<BR>6)&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;Now update 
            tabCotnro11_Click to populate the list when the tab is 
            activated:<BR></FONT></B>Private Sub TabControl1_Click(ByVal sender 
            As Object, ByVal e As System.EventArgs)<BR>Handles 
            TabControl1.Click<BR>If TabControl1.SelectedIndex = 0 
            Then<BR>AxToolbarControl1.SetBuddyControl(AxSceneControl1)<BR>AxToolbarControl1.RemoveAll()<BR>AxToolbarControl1.AddItem("esri3DAnalyst.ControlsSceneOpenDocCommand", 
            , -1, False, 
            ,<BR>esriCommandStyles.esriCommandStyleIconAndText)<BR>AxTOCControl1.SetBuddyControl(AxSceneControl1) 
            ' Buddy the Scene<BR>Me.Text = "3D Controls - " + 
            AxSceneControl1.DocumentFilename<BR>Functions.AddLayerToList(lstLayers, 
            Functions.GetSceneLayers(m_scene))<BR>Else<BR>AxToolbarControl1.SetBuddyControl(AxGlobeControl1)<BR>AxToolbarControl1.RemoveAll()<BR>AxToolbarControl1.AddItem("esriGlobeCore.ControlsGlobeOpenDocCommand", 
            , -1, False, 
            ,<BR>esriCommandStyles.esriCommandStyleIconAndText)<BR>AxTOCControl1.SetBuddyControl(AxGlobeControl1) 
            ' Buddy the Globe<BR>Me.Text = "3D Controls - " + 
            AxGlobeControl1.DocumentFilename<BR>End If<BR>End sub<BR><B><FONT 
            size=3>7)&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;Save and build the 
            solution.<BR>8)&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;Run the 
            application and test the code. Try adding the dvim3.tif file file 
            from the \student\daae\data\scenedata\data 
            directory.</FONT></B><BR><BR>[<I> 本帖最后由 北斗星 于 2007-3-13 11:30 PM 编辑 
            </I>]</DIV></TD></TR>
        <TR>
          <TD vAlign=bottom><BR><BR><BR><IMG alt="" 
            src="使用ArcGIS Engine 开发自定义GIS应用--第六部分(续实例二) - GIS大讲堂.files/sigline.gif"><BR>
            <DIV class=signature 
            style="OVERFLOW: hidden; max-height: 20em; maxHeight: 245px">欢迎参加ESRI2007巡展</DIV></TD></TR>
        <TR>
          <TD align=right>&nbsp;<A 
            href="http://bbs.esrichina-bj.cn/ESRI/post.php?action=reply&amp;fid=14&amp;tid=6656&amp;repquote=33845&amp;extra=page%3D1">引用</A> 
            &nbsp;<A 
            href="http://bbs.esrichina-bj.cn/ESRI/misc.php?action=report&amp;fid=14&amp;tid=6656&amp;pid=33845&amp;page=1">报告</A> 
            <A onclick="fastreply('回复 #2 北斗星 的帖子')" 
            href="http://bbs.esrichina-bj.cn/ESRI/viewthread.php?tid=6656&amp;extra=page%3D1###">回复</A> 
            <A onclick=scroll(0,0) 
            href="http://bbs.esrichina-bj.cn/ESRI/viewthread.php?tid=6656&amp;extra=page%3D1###"><IMG 
            alt=顶部 
            src="使用ArcGIS Engine 开发自定义GIS应用--第六部分(续实例二) - GIS大讲堂.files/top.gif" 
            border=0></A> </TD></TR>
        <TR class=t_infoline>
          <TD class=line 
          style="PADDING-RIGHT: 5px; PADDING-LEFT: 5px; PADDING-BOTTOM: 5px; PADDING-TOP: 5px">[广告] 
            <A 
            href="http://bbs.esrichina-bj.cn/ESRI/viewthread.php?tid=10492&amp;extra=page%3D1" 
            target=_blank>献爱心,迎特奥——ESRI助上海残联造福残疾人事业</A></TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE></DIV>
<DIV class=spaceborder style="MARGIN-BOTTOM: 4px; WIDTH: 98%">
<TABLE class=t_row cellSpacing=0 cellPadding=4 width="100%" align=center>
  <TBODY>
  <TR style="HEIGHT: 100%">
    <TD class=t_user vAlign=top width="18%"><A class=bold 
      href="http://bbs.esrichina-bj.cn/ESRI/viewpro.php?uid=5624" 
      target=_blank>北斗星</A> <SPAN class=smalltxt>(北斗星)</SPAN> <BR>
      <DIV class=smalltxt>超级版主<BR><IMG alt="Rank: 8" 
      src="使用ArcGIS Engine 开发自定义GIS应用--第六部分(续实例二) - GIS大讲堂.files/star_level3.gif"><IMG 
      alt="Rank: 8" 
      src="使用ArcGIS Engine 开发自定义GIS应用--第六部分(续实例二) - GIS大讲堂.files/star_level3.gif"><BR><BR>
      <TABLE style="TABLE-LAYOUT: fixed; OVERFLOW: hidden" cellSpacing=0 
      cellPadding=0 width="95%" border=0>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -