IGeometryCollection Interface

Come from ArcGIS Online IGeometryCollection Interface

Provides access to members that can be used for accessing, adding and removing individual geometries of a multi-part geometry (Multipoint, Polyline, Polygon, MultiPatch, and GeometryBag).

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Description

A Collection of Geometry parts.  For Multipoints, Triangles, TriangleFans, and TriangleStrips, the Geometry parts are Points. For Polylines, the Geometry parts are Paths.  For Polygons, the Geometry parts are Rings.  For MultiPatches, the Geometry parts are Triangles, TriangleFans, TriangleStrips, or Rings.  For GeometryBags, the Geometry parts are any IGeometry object.

The GeometryCollection can be used to access, manipulate, add, insert, remove, and set specific parts of a composite geometry.

When To Use

If you are using a development language that does not support C style arrays, use IGeometryBridge instead. The IGeometryBridge interface solves that problem allowing you to pass safe arrays instead.

Members


Description

 
AddGeometries


Adds references to the specified geometries. This method is intended for internal use only.

 
AddGeometry


Adds a reference to the input geometry either at the end, or before, or after the specified index.

 
AddGeometryCollection


Adds references to geometries in the input collection.

 
GeometriesChanged


Tells this geometry collection that some of its geometries have been altered. Use this method on polylines, polygons and multipatches after directly editing one of its parts.

 
Geometry


A reference to the ith geometry.

 
GeometryCount


The number of geometries in this collection.

 
InsertGeometries


Inserts at the specified index references to some number of geometries in the input array. This method is intended for internal use only.

 
InsertGeometryCollection


Inserts at the specified index references to all if the geometries in the input collection.

 
QueryGeometries


Populates the array with references to a sub-sequence of geometries. This method is intended for internal use only.

 
RemoveGeometries


Removes references to some geometries from this collection.

 
SetGeometries


Replaces all geometries in the collection with the specified number of references to those in the input array. This method is intended for internal use only.

 
SetGeometryCollection


Replaces all geometries in the collection with references to geometries from the input collection.

CoClasses that implement IGeometryCollection


CoClasses and Classes


Description


GeoEllipse (esriDefenseSolutions)


Its a spheroidal ellipse.


GeometryBag


An ordered collection of objects that support the IGeometry interface.


GeoPolygon (esriDefenseSolutions)


Its a spheroidal polygon.


GeoPolyline (esriDefenseSolutions)


This is a spheroidal polyline.


MultiPatch


A collection of surface patches.


Multipoint


An ordered collection of points; optionally has measure, height and ID attributes.


Polygon


A collection of rings ordered by their containment relationship; optionally has measure, height and ID attributes.


Polyline


An ordered collection of paths; optionally has measure, height and ID attributes.


TriangleFan


A continuous 3D fan of triangles, where each triangle after the first shares an edge with the preceding triangle, and all triangles share a common pivot point.


Triangles


A collection of 3D triangles, where each consecutive triplet of vertices defines a new triangle


TriangleStrip


A continuous 3D strip of triangles, where each triangle after the first shares an edge with the preceding triangle.

Remarks

Every Geometry created within ArcGIS should be assigned a spatial reference. Always attach well-defined spatial references to new geometries. This improves processing efficiency, in particular, when using ITopologicalOperator on geometries that contain curved segments (circular arcs, bezier curves, elliptical arcs). New geometries include any geometry that is created in memory. It does not matter whether it will be stored in a feature class or not. Well-defined as applied to a spatial reference means that it not only has its coordinate system (projection) defined, but also its coordinate grid. The coordinate grid consists of the xy domain, xy resolution, and xy cluster tolerance properties of a spatial reference. If the Geometry includes z or m values, the z or m domains, z or m resolutions, and z or m cluster tolerance properties must also be defined. The cluster tolerance and resolutions can be quickly and easily set using SetDefault methods on ISpatialReferenceResolution and ISpatialReferenceTolerance interfaces.

//The example shows a GeometryCollection for MultiPoint.
public void ShowGeometries()
{

    IGeometryCollection geometryCollection = new MultipointClass();
    //add 10 points in a loop
    object missing = Type.Missing;

    for (int i = 0; i < 10; i++)
    {
        IPoint point = new PointClass();
        point.PutCoords(i * 10, i * 2);
        geometryCollection.AddGeometry(point as IGeometry, ref missing, ref missing);
    }

    int geometryCount = geometryCollection.GeometryCount;
    System.Windows.Forms.MessageBox.Show("GeometryCount = " + geometryCount);

    for (int i = 0; i < geometryCount; i++)
    {
        IGeometry currentGeometry = geometryCollection.get_Geometry(i);
        IPoint point = currentGeometry as IPoint;

        //we know that there are IPoints only in the Geometrycollection.
        //But this is the safe and recommended way
        if (point != null)
        {
            System.Windows.Forms.MessageBox.Show("X = " + point.X + ", Y = " + point.Y);
        }

    }

}
时间: 2024-10-18 16:12:10

IGeometryCollection Interface的相关文章

关于在交叉点处打断线的问题总结(*待续)

问题:将相互交叉的线从交点处打断,并且需要得到所有两个交叉点间的线段(下图中的A). 解决思路: (1)将所有的线进行拼接,成为一个IPolyline: (2)使用ITopologicalOperator接口对线集合IPolyline进行在交点处的打断操作: (3)为得到两个交叉点间的线段,需要将IPolyline转成IGeometryCollection,IGeometryCollection中即为所需的所有两个交叉点间的线段集合,在arcgis的在线帮助文档中有对Polyline 的相关介绍

Adding New Functions to MySQL(User-Defined Function Interface UDF、Native Function)

catalog 1. How to Add New Functions to MySQL 2. Features of the User-Defined Function Interface 3. User-Defined Function 4. UDF Argument Processing 5. UDF Return Values and Error Handling 6. UDF Compiling and Installing 7. Adding a New Native Functio

Interface接口

一.接口及作用 接口是一个非常重要的概念,理解这个,先举一个实现生活中的实例. 现在,电脑主板,有很多插槽,可用来插CPU.内存等.当CPU等元件需要更新换代升级时,只要将CPU单独更换就可以了,而不需要更换主板.其实,主板上的这些暴露在外的插槽,就可以理解为接口. 接口就是对外暴露的规则,只要符合规则的CPU.内存,不论品牌.型号.规格,都可以安插使用. 接口是程序的功能扩展.有了插槽,也就提高了主板的功能扩展性,比如内存不够用了,我们就可以换成内容最大的内存条,或再加新的内存条. 接口降低了

一个Interface 继承多个Interface 的总结

我们知道在Java中的继承都是单继承的,就是说一个父类可以被多个子类继承但是一个子类只能有一个父类.但是一个接口可以被不同实现类去实现,这就是我们说的Java中的多态的概念.下面我们再来说一下接口的多继承的概念,就是说一个接口是可以继承多个接口的. 下面是我们公司自己开发的ORM框架,就用到了接口的多继承的概念. @MybatisRepository public interface BaseQueryDao<T> extends IBaseQueryDao<T>, Dynamic

【翻译】Android Interface Definition Language (AIDL)

参考地址:https://developer.android.com/guide/components/aidl.html Android Interface Definition Language (AIDL) AIDL (Android Interface Definition Language) is similar to other IDLs you might have worked with. It allows you to define the programming inter

JAVA之旅(七)——final关键字 , 抽象类abstract,模板方法模式,接口interface,implements,特点,扩展

JAVA之旅(七)--final关键字 , 抽象类abstract,模板方法模式,接口interface,implements,特点,扩展 OK,我们继续学习JAVA,美滋滋的 一.final 我们来聊聊final这个关键字 final可以修饰类,方法和变量 final修饰的类不可以被继承 final修饰的方法不可以被覆盖 final修饰的变量是一个常量,只能被赋值一次 内部类只能访问被final修饰的局部变量 final,故名思意,就是最终的意思,由以上的五种特性,不过final的出现,也是有

重构第9天:提取接口(Extract Interface)

理解:提取接口的意思是,多于一个类共同使用某个类中的方法或属性,那么我们可以把这些方法和属性提出来,作为一个单独的接口.这样的好处是解除代码间的依赖,降低耦合性. 详解: 先看重构前的代码: 1 public class ClassRegistration 2 { 3 public void Create() 4 { 5 // create registration code 6 } 7 8 public void Transfer() 9 { 10 // class transfer code

JavaSE入门学习21:Java面向对象之接口(interface)(二)

一接口实现的多态 在上一篇博文:JavaSE入门学习20:Java面向对象之接口(interface)(一)中提到了接口的实现存在多态性,那么 这一篇主要就要分析接口实现的多态. 实例一 Test.java源文件代码: public class Test{ public static void main(String[] args){ //实现接口Singer Singer s1 = new Student("Amy"); s1.sing(); s1.sleep(); s1.study

11)Java abstract class 和 interface

abstract class 和 interface 的区别 ? ? ?含有abstract修饰符的class即为抽象类,abstract 类不能创建实例对象.含有abstract方法的类必须定义为abstract class,abstract class类中的方法不一定是抽象的. ? ? ?abstract class类中定义抽象方法必须在具体(Concrete)子类中实现,所以,不能有抽象构造方法或抽象静态方法.如果子类没有实现抽象父类中的所有抽象方法,那么子类也必须定义为abstract类