实现思路:
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;
}