欢迎您来到GIS动力

加入收藏 免费注册 用户登陆 帮助中心
首页 新闻动态 技术专栏 银杏树下 学习考研 软件下载 求职招聘 许愿瓶 节日祝福 用户中心 精彩推荐 资源搜索 地图
专栏导航: AO开发 | SO开发 | ArcGIS桌面 | 超图桌面 | 开发语言 | 数据库 | WebGIS | 银杏文学 | 研究生考题 | FreeMap 谈天说地
   您现在位于: 首页技术专栏ArcGIS应用与开发AO开发 → 正文
要素动态跟踪的算法
07-12-04 00:00:00 作者:浩淼的天空 出处:浩淼的天空

这个算法其实很简单,核心原理是在一个timer_tick事件中不断改变一个markerElement的geometry。而我们关注的目标也是这些符合条件的geometry如何得到。

1.polyline上的节点
我们我们要取一条polyline上的节点,这个方法是非常简单的,使用ipointcollection接口对象ppts,我们通过QI一条polyline,可以获取这些点集合。
dim ppts as ipointcollection
ppts=ppolyline
其中的点从ppts.point(i)中取得

2.获取均匀点
如果一条线很长,但是只有一个segment,那么点将很快移动完毕,这样肯定我们也不满意,我们希望能够不管线的长度是多少,一定要让点移动10次,我们就必须找出一条线上等距离的11个点的位置出来,算法如下:

Function MakeMultiPoint(ByVal pGeometry As IGeometry, ByVal nPoints As Integer) As IGeometryCollection
        Dim pGeometryCollection As IGeometryCollection
        If TypeOf pGeometry Is IPolyline Then
            ' return a multipoint containing nPoints equally
            ' distributed on the Polyline
            Dim pConstructGeometryCollection As IConstructGeometryCollection
            pConstructGeometryCollection = New GeometryBag
            pConstructGeometryCollection.ConstructDivideEqual(pGeometry, nPoints - 1, esriConstructDivideEnum.esriDivideIntoPolylines)
            Dim pEnumGeometry As IEnumGeometry
            pEnumGeometry = pConstructGeometryCollection
            pGeometryCollection = New Multipoint
            Dim pPolyline As IPolyline
            pPolyline = pEnumGeometry.Next
            pGeometryCollection.AddGeometry(pPolyline.FromPoint)
            Do While Not pPolyline Is Nothing
                pGeometryCollection.AddGeometry(pPolyline.ToPoint)
                pPolyline = pEnumGeometry.Next
            Loop
        End If
        MakeMultiPoint = pGeometryCollection
        pGeometryCollection = Nothing
    End Function
这个函数可取出符合要求的点集出来。

(本文已被浏览 次)
发布人: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号