IPolygon Interface

Provides access to members that identify a polygon and permit controlled access to its inner and outer rings.

Description

A polygon is a collection of one or many exterior and interior rings. The rings do not need to be connected to or contained by other rings in the polygon. However, all rings are considered to be part of a single polygon regardless of their location. Rings can be embedded in the interior of other rings. Embedded rings define interior boundaries or holes within the polygon. Exterior rings are oriented in a clockwise direction while interior rings are oriented counterclockwise.

Members

Name Description
Method Close Closes all rings in this polygon. The resulting polygon may not be simple.
Method Densify Converts this polycurve into a piecewise linear approximation of itself.
Read-only property Dimension The topological dimension of this geometry.
Read-only property Envelope Creates a copy of this geometry's envelope and returns it.
Read-only property ExteriorRingCount The number of exterior rings.
Method FindExteriorRing Returns the exterior ring containing the specified interior ring.
Read/write property FromPoint The 'from' point of the curve.
Method Generalize Generalizes this polycurve using the Douglas-Peucker algorithm.
Read-only property GeometryType The type of this geometry.
Method GeoNormalize Shifts longitudes, if need be, into a continuous range of 360 degrees.
Method GeoNormalizeFromLongitude Normalizes longitudes into a continuous range containing the longitude. This method is obsolete.
Method GetSubcurve Extracts a portion of this curve into a new curve.
Read-only property InteriorRingCount The number of rings interior to the specified exterior ring.
Read-only property IsClosed Indicates if 'from' and 'to' points (of each part) are identical.
Read-only property IsEmpty Indicates whether this geometry contains any points.
Read-only property Length The length of the curve.
Method Project Projects this geometry into a new spatial reference.
Method QueryEnvelope Copies this geometry's envelope properties into the specified envelope.
Method QueryExteriorRings Populates an array with references to all exterior rings. This method does not marshall correctly out-of-proc. Use QueryExteriorRingsEx on the IPolygon2 interface instead.
Method QueryFromPoint Copies this curve's 'from' point to the input point.
Method QueryInteriorRings Populates an array with references to rings that are interior to the specified exterior ring. This method does not marshall correctly out-of-proc. Use QueryInteriorRingsEx on the IPolygon2 interface instead.
Method QueryNormal Constructs a line normal to a curve from a point at a specified distance along the curve.
Method QueryPoint Copies to outPoint the properties of a point on the curve at a specified distance from the beginning of the curve.
Method QueryPointAndDistance Finds the point on the curve closest to inPoint, then copies that point to outPoint; optionally calculates related items.
Method QueryTangent Constructs a line tangent to a curve from a point at a specified distance along the curve.
Method QueryToPoint Copies the curve's 'to' point into the input point.
Method ReverseOrientation Reverses the parameterization of the curve ('from' point becomes 'to' point, first segment becomes last segment, etc).
Method SetEmpty Removes all points from this geometry.
Method SimplifyPreserveFromTo Simplifies the polygon and maintains the index location of the from/to point of each ring.
Method Smooth Converts this curve into a smooth curve containing only Bezier curve segments.
Method SnapToSpatialReference Moves points of this geometry so that they can be represented in the precision of the geometry's associated spatial reference system.
Read/write property SpatialReference The spatial reference associated with this geometry.
Method SplitAtDistance Introduces a new vertex into this polyline at a specified distance from the beginning of the polyline.
Method SplitAtPoint Introduces a new vertex into this polyline at the location on it closest to the input point.
Read/write property ToPoint The 'to' point of the curve.
Method Weed Generalizes using a small tolerance based upon either the system units of the geometry's spatial reference, or the geometry's bounding box.

IPolygon.Close Method

Closes all rings in this polygon. The resulting polygon may not be simple.

Public Sub Close ( _
)
public void Close (
);

Description

Closes all Rings in the Polygon by adding a Segment between the To Point and From Point of each Ring if those points are not already identical. This may result in a non-simple Polygon with Rings crossing each other. Also, this only closes the last segment and does not fix improperly constructed Rings.

IPolygon.ExteriorRingCount Property

The number of exterior rings.

Public ReadOnly Property ExteriorRingCount As Integer
public int ExteriorRingCount {get;}

Description

Returns the number of Exterior Rings that are part of the polygon. Exterior Rings have a clockwise orientation.

Remarks

IPolygon ExteriorRingCount Example

IPolygon.FindExteriorRing Method

Returns the exterior ring containing the specified interior ring.

Public Function FindExteriorRing ( _
    ByVal interiorRing As IRing _
) As IRing
public IRing FindExteriorRing (
    IRing interiorRing
);

Description

Returns the Exterior Ring to which the input Interior Ring belongs. Every interior ring belongs to one and only one exterior ring.

Remarks

IPolygon FindExteriorRing Example

IPolygon.InteriorRingCount Property

The number of rings interior to the specified exterior ring.

Public Function get_InteriorRingCount ( _
    ByVal exteriorRing As IRing _
) As Integer
public int get_InteriorRingCount (
    IRing exteriorRing
);

Description

Returns the number of Interior Rings within the given Exterior Ring. Interior Rings have a counterclockwise orientation.

Remarks

IPolygon InteriorRingCount Example

Does not work in .NET. Use IPolygon4.get_InteriorRingCount instead.

IPolygon.QueryExteriorRings Method

Populates an array with references to all exterior rings. This method does not marshall correctly out-of-proc. Use QueryExteriorRingsEx on the IPolygon2 interface instead.

Public Sub QueryExteriorRings ( _
    ByRef exteriorRings As IRing _
)
public void QueryExteriorRings (
    ref IRing exteriorRings
);

Description

Returns an array of IRings containing all of the Exterior Rings in the Polygon. Whenever possible, IPolygon2::QueryExteriorRingsEx should be used instead to ensure proper functionality and better control of the returned array.

Remarks

Note : That method only accepts an array of type IRing for exteriorRings. Using an array of IRing2 won't work.

IPolygon QueryExteriorRings Example

Does not work in .NET. Use IPolygon4.ExteriorRingBag instead.

IPolygon.QueryInteriorRings Method

Populates an array with references to rings that are interior to the specified exterior ring. This method does not marshall correctly out-of-proc. Use QueryInteriorRingsEx on the IPolygon2 interface instead.

Public Sub QueryInteriorRings ( _
    ByVal exteriorRing As IRing, _
    ByRef interiorRings As IRing _
)
public void QueryInteriorRings (
    IRing exteriorRing,
    ref IRing interiorRings
);

Description

Returns an array of IRings containing all Interior Rings belonging to a specified input Exterior Ring. Whenever possible, IPolygon2::QueryInteriorRingsEx should be used to ensure proper functionality and better control of the returned array.

Remarks

Note : That method only accepts an array of type IRing for interiorRings. Using an array of IRing2 won't work.

Does not work in .NET. Use IPolygon4.get_InteriorRingBag instead.

IPolygon.SimplifyPreserveFromTo Method

Simplifies the polygon and maintains the index location of the from/to point of each ring.

Public Sub SimplifyPreserveFromTo ( _
)
public void SimplifyPreserveFromTo (
);

Description

SimplifyPreserveFromTo simplifies the polygon in the same manner as the ITopologicalOperator method Simplify, but once simplification is complete, SimplifyPreserveFromTo reorients each ring such that the original From/To points of each preexisting ring are in the simplified result. Newly created rings are not reoriented.

Remarks

SimplifyPreserveFromTo Example

Inherited Interfaces

Interfaces Description
IPolycurve Provides access to members that define operations common to polylines and the boundaries of polygons.
ICurve Provides access to properties and methods of all 1 dimensional curves (polylines, segments, boundaries of polygons, etc.).
IGeometry Provides access to members that describe properties and behavior of all geometric objects.

Classes that implement IPolygon

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

Remarks

To define a polygon containing many disjoint rings, the polygon must be defined as a GeometryCollection to which preconstructed ring geometries are added. Adding segments to a polygon defined as a SegmentCollection, or points to a polygon defined as a PointCollection, assumes that the polygon is a single ring of connected segments.

IPolygon2 extends the functionality of IPolygon.

Polygons

Your browser is no longer supported. Please upgrade your browser for the best experience. See our browser deprecation post for more details.