zoukankan      html  css  js  c++  java
  • ArcEngine生成矩形缓冲区

    这里生成缓冲区肯定是根据点进行生成的,说是生成缓冲区其实是根据点生成面。具体思路如下:
    首先根据点获取要生成矩形缓冲区的四个顶点的坐标,然后将这四个点生成面即可得到所谓的矩形缓冲区。

    //首先获取要生成缓冲区的点
    IPoint pPoint = new PointClass();
    pPoint.X = cPointList[i].point.X;
    pPoint.Y = cPointList[i].point.Y;
    //获取生成的缓冲区的四个顶点的坐标
    IPointCollection pPC = new MultipointClass();
    for (int j = 0; j < 4; j++)
    {
    IPoint pPoint1 = new PointClass();
    if (j == 0)
    {
    pPoint1.X = pPoint.X - 2.55;
    pPoint1.Y = pPoint.Y - 2.55;
    }
    if (j == 1)
    {
    pPoint1.X = pPoint.X - 2.55;
    pPoint1.Y = pPoint.Y + 2.55;
    } if (j == 2)
    {
    pPoint1.X = pPoint.X + 2.55;
    pPoint1.Y = pPoint.Y + 2.55;
    } if (j == 3)
    {
    pPoint1.X = pPoint.X + 2.55;
    pPoint1.Y = pPoint.Y - 2.55;
    }
    pPC.AddPoint(pPoint1);
    }
    IGeometryCollection pGeometryCollection = new PolygonClass();
    Ring ring = new RingClass(http://www.my516.com);
    object missing = Type.Missing;
    ring.AddPointCollection(Points);
    pGeometryCollection.AddGeometry(ring as IGeometry, ref missing, ref missing);
    IPolygon polyGonGeo = pGeometryCollection as IPolygon;
    polyGonGeo.Close();
    polyGonGeo.SimplifyPreserveFromTo();
    pGeo =polyGonGeo as IGeometry;
    //创建要素
    pFeatureBuffer = pFeaClaPolygon.CreateFeatureBuffer();
    pFeatureBuffer.Shape = pGeo;
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    结果图:下图为点生成矩形缓冲区的最终成果。

    这个是融合之后的图形。


    当然在进行顶点坐标输入的时候需要按照顺序,不然就会出现下边这种情况:
    --------------------- 

  • 相关阅读:
    C#开源框架
    8 种 NoSQL 数据库系统对比
    安装补丁“此更新不适用于你的计算机”解决办法
    .net开源资料
    winform程序退出
    jquery.chained与jquery.chained.remote使用以及区别
    存储过程使用回滚
    C# Panel中绘图如何出现滚动条
    C#结构体的特点浅析
    如何用堆栈和循环结构代替递归调用--递归转换为非递归的10条军规
  • 原文地址:https://www.cnblogs.com/ly570/p/11026679.html
Copyright © 2011-2022 走看看