com.esri.arcgis.geometry
Interface IPolygon

All Superinterfaces:
ICurve, IGeometry, IPolycurve, Serializable
All Known Subinterfaces:
IPolygon2, IPolygon3, IPolygon4
All Known Implementing Classes:
Polygon

public interface IPolygon
extends IPolycurve, Serializable

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

Superseded By

IPolygon4

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.

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

Product Availability

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

See Also:
IPolycurve, IPointCollection, IGeometry, IRing, ISegmentCollection, IGeometryCollection

Method Summary
 void close()
          Closes all rings in this polygon.
 IRing findExteriorRing(IRing interiorRing)
          Returns the exterior ring containing the specified interior ring.
 int getExteriorRingCount()
          The number of exterior rings.
 int getInteriorRingCount(IRing exteriorRing)
          The number of rings interior to the specified exterior ring.
 void queryExteriorRings(IRing exteriorRings)
          Populates an array with references to all exterior rings.
 void queryInteriorRings(IRing exteriorRing, IRing interiorRings)
          Populates an array with references to rings that are interior to the specified exterior ring.
 void simplifyPreserveFromTo()
          Simplifies the polygon and maintains the index location of the from/to point of each ring.
 
Methods inherited from interface com.esri.arcgis.geometry.IPolycurve
densify, generalize, smooth, splitAtDistance, splitAtPoint, weed
 
Methods inherited from interface com.esri.arcgis.geometry.ICurve
getFromPoint, getLength, getSubcurve, getToPoint, isClosed, queryFromPoint, queryNormal, queryPoint, queryPointAndDistance, queryTangent, queryToPoint, reverseOrientation, setFromPoint, setToPoint
 
Methods inherited from interface com.esri.arcgis.geometry.IGeometry
geoNormalize, geoNormalizeFromLongitude, getDimension, getEnvelope, getGeometryType, getSpatialReference, isEmpty, project, queryEnvelope, setEmpty, setSpatialReferenceByRef, snapToSpatialReference
 

Method Detail

findExteriorRing

IRing findExteriorRing(IRing interiorRing)
                       throws IOException,
                              AutomationException
Returns the exterior ring containing the specified interior ring.

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

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

Parameters:
interiorRing - A reference to a com.esri.arcgis.geometry.IRing (in)
Returns:
A reference to a com.esri.arcgis.geometry.IRing
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getExteriorRingCount

int getExteriorRingCount()
                         throws IOException,
                                AutomationException
The number of exterior rings.

Description

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

Remarks

IPolygon ExteriorRingCount Example

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

Returns:
The cExteriorRings
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

queryExteriorRings

void queryExteriorRings(IRing exteriorRings)
                        throws IOException,
                               AutomationException
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.

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

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

Parameters:
exteriorRings - A reference to a com.esri.arcgis.geometry.IRing (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getInteriorRingCount

int getInteriorRingCount(IRing exteriorRing)
                         throws IOException,
                                AutomationException
The number of rings interior to the specified exterior ring.

Product Availability

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

Parameters:
exteriorRing - A reference to a com.esri.arcgis.geometry.IRing (in)
Returns:
The cInteriorRings
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

queryInteriorRings

void queryInteriorRings(IRing exteriorRing,
                        IRing interiorRings)
                        throws IOException,
                               AutomationException
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.

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.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

Parameters:
exteriorRing - A reference to a com.esri.arcgis.geometry.IRing (in)
interiorRings - A reference to a com.esri.arcgis.geometry.IRing (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

close

void close()
           throws IOException,
                  AutomationException
Closes all rings in this polygon. The resulting polygon may not be simple.

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.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

simplifyPreserveFromTo

void simplifyPreserveFromTo()
                            throws IOException,
                                   AutomationException
Simplifies the polygon and maintains the index location of the from/to point of each ring.

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

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.