IRings
Polygons are made up of rings. A ring is closed path that defines a 2D area, whose first and last point are the same. This interface provides access to a polygon’s rings, providing methods to add and delete rings from a polygon object.
|
Properties |
|
|
Gets the number of rings in a geometry. |
|
|
Gets the ILinearRing element in the specified zero-based index. |
|
|
Methods |
|
|
Adds a ring to a polygon. |
|
|
Deletes a ring from a polygon. |
Count
Gets the number of rings in a geometry.
JavaScript |
|
Count |
C# |
|
int Count { get; } |
C++ |
|
HRESULT Count([out, retval] long* pVal) |
Item
Gets the ILinearRing element in the specified zero-based index. To access a specific element use the following syntax: IRings(index).
C# exposes this property as an indexer accessed using the following syntax: IRings[index].
JavaScript |
|
Item( Index) |
C# |
|
dynamic this[object Index] { get; } |
C++ |
|
HRESULT Item( [in] VARIANT Index, [out, retval] VARIANT* pVal) |
AddRing
Adds a ring to the geometry.
JavaScript |
|
AddRing( var) |
C# |
|
ILinearRing AddRing( object var = 0) |
C++ |
|
HRESULT AddRing( VARIANT var, ILinearRing** pVal) |
Parameters
var
Any of the following can be passed:
· LinearRing WKT
See “Well-Known Text Representation for Geometric Objects” in the “Overview” chapter for background information on WKT and WKB.
· A Safe Array of Vertices– An array that contains triplets of doubles. Each triplet is composed of an x-coordinate, a y-coordinate, and a height. The height is represented in meters and the x- and y-coordinates are represented in the coordinate system’s units. You can use the ITerrain80 interface to retrieve information about the coordinate system units.
Note: In JavaScript, use the VBArray object. E.g.,
var points = geom.Points.ToArray()
var arr = new VBArray(points).toArray();
Return Value
pVal
An ILinearRing representing the newly created ring.
Exceptions
See: HRESULT Return Values for a list of possible values returned by the HRESULT.
DeleteRing
Deletes a ring from a geometry.
JavaScript |
|
DeleteRing( Index) |
C# |
|
void DeleteRing( int Index) |
C++ |
|
HRESULT DeleteRing([in] long Index) |
Parameters
Index
The zero-based index of the ring to delete. Use IRings.Count to determine the number of rings.
Exceptions
See: HRESULT Return Values for a list of possible values returned by the HRESULT.