Arcengine 根据坐标串生成几何图形

实现思路:

1、解析字符串,把字符串分解成多个RING

2、把RING依次添加到 pGeometryCollection 中

3、把pGeometryCollection解析成几何图形

生成的图形如下:

相关代码如下:

        private IGeometryCollection AddRing(IGeometryCollection pGeometryCollection, IPointCollection Points)
        {
            Ring ring = new RingClass();
            object missing = Type.Missing;

            ring.AddPointCollection(Points);
            pGeometryCollection.AddGeometry(ring as IGeometry, ref missing, ref missing);
            return pGeometryCollection;
        }

 

         private IGeometry getGeometry(IGeometryCollection pGeometryCollection)
        {
            IPolygon polyGonGeo = pGeometryCollection as IPolygon;
            polyGonGeo.Close();
            polyGonGeo.SimplifyPreserveFromTo();
            return polyGonGeo as IGeometry;
        }

posted @ 2016-05-27 11:47  恋上微笑的天使  阅读(979)  评论(0编辑  收藏  举报