ArcGIS Engine 10 开发手册(5-11)Geometry集合接口(三)

ArcGIS Engine 10 开发手册(5-11)Geometry集合接口(三)
本文介绍Geometry集合接口的使用示例。

    本文介绍Geometry集合接口的使用示例。


     示例等距离打断线

private IEnumGeometry MakeMultiPoints (IPolyline pGeometry, int inPoints)

 

{

 

  IConstructGeometryCollection pConGeoCollection = new GeometryBagClass ();

 

  pConGeoCollection.ConstructDivideEqual (pGeometry, inPoints,esriConstructDivideEnum.esriDivideIntoPolylines);

 

  IEnumGeometry pEnumGeometry = pConGeoCollection as IEnumGeometry;

 

  return pEnumGeometry;

 

}

      IGeometryBag vs. IGeometryCollection

       GeometryBag 是支持 IGeometry 接口的 几何对象引 用的集合, 任何几何对 象都可以通 过 IGeometryCollection 接口添加到 GeometryBag 中,但是在使用拓扑操作的时候,需要注意不同类型的几 何类型可能会有相互不兼容的情况。在向 GeometryBag 中添加几何对象的时候,GeometryBag 对象需要指 定空间参考,添加到其中的几何对象均拥有和 GeometryBag 对象一样的空间参考。在 GIS 中,矢量数据模 型是地理数据的重要表现形式,而 Esri 提供了多种方式对矢量数据进行管理,shpfile,coverage 以及 Geodatabase。在 Geodatabase 中,一个要素类的一条记录都有一个 Shape 字段,而这个 Shape 字段就存储 了我们的空间形体。这个空间形体用来精确的描述现实世界中的空间对象,我们知道 ArcGIS 中提供了众多 的空间分析工具,而这些分析就是对这个 Shape 进行操作的。