IGeometryCollection

This interface gives access to geometry collections, providing methods for accessing, adding and removing individual geometries of a multi-part geometry (multipoint, multilinestring, multipolygon). For multipoints, the geometry parts are points. For multilinestrings, the geometry parts are linestrings. For multipolygons, the geometry parts are polygons.

 

 

Properties

 

Count

Gets the number of geometries in the collection.

Dimension

Gets the dimension of the collection. (Inherited from IGeometry)

Envelope

Gets the collection’s bounding box. (Inherited from IGeometry)

Geometry

Gets the IGeometry element in the specified zero-based index.

GeometryType

Gets the collection’s geometry type. (Inherited from IGeometry)

GeometryTypeStr

Gets a string representation of the collection type. (Inherited from IGeometry)

Item

Gets the IGeometry element in the specified zero-based index.

NumGeometries

Gets the number of geometries in this collection.

SpatialOperator

An ISpatialOperator representing the selected collection’s interaction with another geometry object. (Inherited from IGeometry)

SpatialRelation

An ISpatialRelation that tests the collection’s spatial relationship with other geometries. (Inherited from IGeometry)

Wks

An IWks representing methods for transferring coordinate system information (WKT and WKB). (Inherited from IGeometry)

 

Methods

 

AddGeometry

Adds a geometry to the collection.

Clone

Returns an exact copy of the selected collection. (Inherited from IGeometry)

DeleteGeometry

Deletes the selected geometry from the collection.

EndEdit

Terminates the edit item mode. (Inherited from IGeometry)

IsEmpty

Returns a Boolean indicating whether the selected geometry collection is empty. (Inherited from IGeometry)

IsSimple

Returns a Boolean indicating whether the geometry collection is simple. (Inherited from IGeometry)

SetEmpty

Removes all geometries from this collection. (Inherited from IGeometry)

StartEdit

Starts the edit item mode. (Inherited from IGeometry)

Count

Gets the number of geometries in the collection.

JavaScript

 

Count

 

C#

 

int Count { get; }

 

C++

 

HRESULT Count([out, retval] long* pVal)

 

Geometry

Gets the IGeometry in the specified zero-based index, representing a specific multiline in the collection. This property is exposed in C# and JavaScript in the following ways:

§   In C#, this property is exposed as Geometry, e.g.,

IGeometryCollection myGeometryCollection;

IGeometry thisGeometry = myGeometryCollection.Geometry[0];

Note:    In older versions of C#, this property is exposed as get_Geometry, e.g.,

IGeometryCollection myGeometryCollection;

IGeometry thisGeometry = myGeometryCollection.get_Geometry[0];

§   In JavaScript use:

var myGeometryCollection;

var thisGeometry = myGeometryCollection.Geometry(0);

 

JavaScript

 

Geometry

 

C#

 

IGeometry Geometry { get; }

 

C++

 

HRESULT Geometry ([in] long Index,

       [out, retval] IGeometry** pVal)

 

 

Item

Gets the IGeometry element in the specified zero-based index.

To access a specific element use the following syntax: IGeometryCollection(index).

C# exposes this property as an indexer accessed using the following syntax: IGeometryCollection[index].

 

JavaScript

 

Item(

       Index)

 

C#

 

dynamic this[object Index] { get; }

 

C++

 

HRESULT Item(

       [in] VARIANT Index,

       [out, retval] VARIANT* pVal)

NumGeometries

Gets the number of geometries in this collection (or 1 if this is not a collection)

 

JavaScript

 

NumGeometries

 

C#

 

int NumGeometries { get; }

 

C++

 

HRESULT NumGeometries( long* pVal)

AddGeometry

Adds a new geometry to the collection.

 

JavaScript

 

AddGeometry(

       pVal)

 

C#

 

IGeometry AddGeometry(

       object pVal)

 

C++

 

HRESULT AddGeometry(

       VARIANT pVal,

       IGeometry** ppIGeometry)

Parameters

pVal

The geometry being created.

Return Value

ppIGeometry

The IGeometry, representing the properties and behavior of the geometry being added.

Exceptions

See: HRESULT Return Values for a list of possible values returned by the HRESULT.

DeleteGeometry

Delete the selected geometry from the collection.

 

JavaScript

 

DeleteGeometry(

       Index)

 

C#

 

void DeleteGeometry(

       int Index)

 

C++

 

HRESULT DeleteGeometry(

       long Index)

Parameters

Index

The zero-based index of the geometry you are deleting.

Exceptions

See: HRESULT Return Values for a list of possible values returned by the HRESULT.