ArcGIS Explorer Component Help |
Polygon..::.GetRings Method |
Polygon Class Example See Also |
Gets the a copy of the points in all of the rings of the Polygon.
Namespace:
ESRI.ArcGISExplorer.GeometryAssembly: ESRI.ArcGISExplorer (in ESRI.ArcGISExplorer.dll) Version: 2.0.0.1500 (2.0.0.1500)
Syntax
C# |
---|
public IList<IList<Point>> GetRings() |
Visual Basic (Declaration) |
---|
Public Function GetRings As IList(Of IList(Of Point)) |
Return Value
An enumerable generic list, in which each item is an enumerable generic list of points which are copies of the points in one ring of the Polygon.Remarks
Use this method to get an object containing a copy of all the points in all the rings of a multipart Polygon. For a single part Polygon, the returned list will contain a single list of points from the single ring in the Polygon.
For an empty Polygon, GetRings will return a list with 0 items.
Examples
The code below shows how to use the GetRings method to enumerate over each vertex in each ring in a Polygon.
The code assumes there is an existing Polygon called poly, and works for both multipart and single part polygons.
CopyC#
// For an existing Polygon called pline, use GetRings to iterate all points in all rings of the Polygon. foreach (List<ESRI.ArcGISExplorer.Geometry.Point> ring in poly.GetRings()) { foreach (ESRI.ArcGISExplorer.Geometry.Point pt in ring) { System.Diagnostics.Debug.WriteLine(pt.ToString()); } }
CopyVB.NET
' For an existing Polygon called poly, use GetRings to iterate all points in all rings of the Polygon. For Each ring As List(Of ESRI.ArcGISExplorer.Geometry.Point) In poly.GetRings() For Each pt As ESRI.ArcGISExplorer.Geometry.Point In ring System.Diagnostics.Debug.WriteLine(pt.ToString()) Next Next