IGeometry 中取指定的点

private static IGeometryCollection MakeMultiPoint(IGeometry geometry,int pointcount)
{
         IGeometryCollection g=new MultipointClass();
         if(geometry.GeometryType==esriGeometryType.esriGeometryPolyline)
{
        IConstructGeometryCollection cc=new GeometryBagClass();
        cc.ConstructDivideEqual(geometry as IPolyline ,pointCount,esriConstructDivideEnum.esriDivideIntoPolylines);
        var enumGeometry=cc as IEnumGeometry;
         var polyline=enumGeometry as IPolyline;
          object o=Type.Missing;
          if(polyline!=null)
          {     
                   g.AddGeometry(poyline.FromPoint,ref o,ref o);
        while(polyline!=null)
        {
                  g.AddGeometry(poyline.ToPoint,ref o,ref o);
                polyline=enumGeometry.Next() as IPolyline;
        }
          }
}
     return g;
}
posted @ 2014-04-03 10:07  天之泉  阅读(676)  评论(1)    收藏  举报