欢迎您来到GIS动力

加入收藏 免费注册 用户登陆 帮助中心
首页 新闻动态 技术专栏 银杏树下 学习考研 软件下载 求职招聘 许愿瓶 节日祝福 用户中心 精彩推荐 资源搜索 地图
专栏导航: AO开发 | SO开发 | ArcGIS桌面 | 超图桌面 | 开发语言 | 数据库 | WebGIS | 银杏文学 | 研究生考题 | FreeMap 谈天说地
   您现在位于: 首页技术专栏SuperMap应用与开发SO开发 → 正文
用C#实现横断面视图
07-10-23 09:10:29 作者:寒蝉 出处:
在管网中,因为管线异常复杂,地下的管线结构和分布位置常常很难检测,而且很难看到各种工程管线的
垂直分布,在本人的毕业设计中,通过查阅各种资料找到了一个自动生成横断面的方法,且已经用代码实现,现在记录下来,免得自己忘了同时也可以给大家分享,有不同意见的同行,同志不要吝啬自己的键盘,欢迎提出宝贵意见,下面是具体的思路:
           第一步:获取截面线与实际管线的所有交点,同时新建一个交点类,保存交点的一些属性数据(如:类型,埋深,直径等),下面是具体的代码:
 1   private   void  GetPouMianTu()
 2          {
 3             SuperMapLib.soGeoLine objGeoLine;  // 保存跟踪层上的线对象
 4             SuperMapLib.soGeoLine objInsectLine;  // 与所画线的相交线
 5             SuperMapLib.soPoints objInsectPoints;  // 所画线的相交点串
 6             SuperMapLib.soPoints tempInsectPoints;
 7             SuperMapLib.soPoints beginPoints;
 8             ArrayList pointTypeArr  =   new  ArrayList();  // 用于保存相交点串的类型
 9              double  beginPointX  =   0 // 所画起点的X坐标
10              double  beginPointY  =   0 ; // 所画起点的Y坐标
11            
12             SuperMapLib.soRecordset objAllRst;
13             SuperMapLib.soDatasetVector objAllDVt;
14            
15              // objInsectPoints = new SuperMapLib.soPoints();
16             beginPoints  =   new  SuperMapLib.soPoints();
17             objGeoLine  =   new  SuperMapLib.soGeoLine();
18             objInsectPoints  =   new  SuperMapLib.soPoints();
19             objInsectLine  =   new  SuperMapLib.soGeoLine();
20             objGeoLine  =  (SuperMapLib.soGeoLine) this .axSuperMap2.TrackedGeometry;
21             beginPoints  =  objGeoLine.GetPartAt( 1 );
22             beginPointX  =  beginPoints[ 1 ].x;
23             beginPointY  =  beginPoints[ 1 ].y;
24                 
25              // =================从给水中找================================= //
26                 
27             objAllDVt  =  (SuperMapLib.soDatasetVector) this .axSuperMap2.Layers[ " 给水@WINXP_JS " ].Dataset;
28             objAllRst  =  objAllDVt.QueryEx( this .axSuperMap2.TrackedGeometry, SuperMapLib.seSpatialQueryMode.scsLineCross,  "" );
29             objAllRst.MoveFirst();
30              while  ( ! objAllRst.IsEOF())
31              {
32                 objInsectLine  =  (SuperMapLib.soGeoLine)objAllRst.GetGeometry();
33                 tempInsectPoints  =  objInsectLine.GetCrossings( this .axSuperMap2.TrackedGeometry);
34
35                 objInsectPoints.Add(tempInsectPoints[ 1 ]);
36                 pointTypeArr.Add( new  PointType(tempInsectPoints[ 1 ],  " 给水 " , objAllRst.GetFieldValue( " 埋深 " ).ToString()));
37                 objAllRst.MoveNext();
38             }

39              // =============================================================== //
40
41              // ======================从雨水中找=============================== //
42             objAllDVt  =  (SuperMapLib.soDatasetVector) this .axSuperMap2.Layers[ " 雨水@WINXP_雨水 " ].Dataset;
43             objAllRst  =  objAllDVt.QueryEx( this .axSuperMap2.TrackedGeometry, SuperMapLib.seSpatialQueryMode.scsLineCross,  "" );
44             objAllRst.MoveFirst();
45              while  ( ! objAllRst.IsEOF())
46              {
47                 objInsectLine  =  (SuperMapLib.soGeoLine)objAllRst.GetGeometry();
48                 tempInsectPoints  =  objInsectLine.GetCrossings( this .axSuperMap2.TrackedGeometry);
49
50                 objInsectPoints.Add(tempInsectPoints[ 1 ]);
51                 pointTypeArr.Add( new  PointType(tempInsectPoints[ 1 ],  " 雨水 " ,objAllRst.GetFieldValue( " 埋深 " ).ToString()));
52                 objAllRst.MoveNext();
53             }

54              // =================================================================== //
55
56              // ======================从污水中找=============================== //
57             objAllDVt  =  (SuperMapLib.soDatasetVector) this .axSuperMap2.Layers[ " 污水@WINXP_污水管 " ].Dataset;
58             objAllRst  =  objAllDVt.QueryEx( this .axSuperMap2.TrackedGeometry, SuperMapLib.seSpatialQueryMode.scsLineCross,  "" );
59             objAllRst.MoveFirst();
60              while  ( ! objAllRst.IsEOF())
61              {
62                 objInsectLine  =  (SuperMapLib.soGeoLine)objAllRst.GetGeometry();
63                 tempInsectPoints  =  objInsectLine.GetCrossings( this .axSuperMap2.TrackedGeometry);
64
65                 objInsectPoints.Add(tempInsectPoints[ 1 ]);
66                 pointTypeArr.Add( new  PointType(tempInsectPoints[ 1 ],  " 污水 " , objAllRst.GetFieldValue( " 埋深 " ).ToString()));
67                 objAllRst.MoveNext();
68             }

69

9 7 3 1 2 3 4 8 :

(本文已被浏览 次)
发布人:admin
推荐给好友:发送给好友
上篇新闻:
下篇新闻:
相关评论
发表我的评论
  • 尊重网上道德,遵守《全国人大常委会关于维护互联网安全的决定》及中华人民共和国其他各项有关法律法;
  • 本站有权保留或删除您发表的任何评论内容;
  •   相关文章  

    关于我们 友情链接 ┋ 与我在线 ┋ 管理 ┋ TOP
    网站当前版本:GisPower CMS V3.0
    『GIS 动力』- http://www.gispower.org/
    联系我们:webmaster#gispower.org
    Copyright (c) 2003-2007 GisPOwer.Org. All Rights Reserved.

                   滇ICP备05006901号