com.esri.core.geometry
Class Polygon

java.lang.Object
  extended by com.esri.core.geometry.Geometry
      extended by com.esri.core.geometry.MultiPath
          extended by com.esri.core.geometry.Polygon
All Implemented Interfaces:
Serializable

public final class Polygon
extends MultiPath
implements Serializable

A polygon is a collection of one or many interior or exterior rings.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class com.esri.core.geometry.Geometry
Geometry.GeometryAccelerationDegree, Geometry.Type
 
Constructor Summary
Polygon()
          Creates a polygon.
 
Method Summary
 double calculateRingArea2D(int ringIndex)
          Calculates the ring area for this ring.
 Geometry createInstance()
          Creates an instance of an empty geometry of the same type.
 boolean equals(Object other)
          Returns TRUE when this geometry has exactly same type, properties, and coordinates as the other geometry.
 com.esri.core.geometry.Point2D[] getCoordinates2D()
          Returns XY coordinates as an array.
 int getDimension()
          Returns the topological dimension of the geometry object based on the geometry's type.
 int getExteriorRingCount()
           
 void getPoint(int index, Point ptOut)
          Returns given vertex of the Geometry by value.
 Geometry.Type getType()
          Returns the geometry type.
 int hashCode()
          Returns a hash code value for this polygon.
 boolean isExteriorRing(int partIndex)
          Returns TRUE if the ring is an exterior ring.
 void setXY(int i, double x, double y)
          Sets a new vertex for the polygon.
 
Methods inherited from class com.esri.core.geometry.MultiPath
_getImpl, add, addAttribute, addEnvelope, addPath, addSegment, applyTransformation, calculateArea2D, calculateLength2D, calculatePathLength2D, closeAllPaths, closePathWithLine, copyTo, dropAllAttributes, dropAttribute, getAttributeAsDbl, getAttributeAsInt, getDescription, getPathCount, getPathEnd, getPathIndexFromPointIndex, getPathSize, getPathStart, getPoint, getPointCount, getSegmentCount, getSegmentCount, getStateFlag, getXY, insertPath, insertPoint, insertPoints, isClosedPath, isClosedPathInXYPlane, isEmpty, lineTo, lineTo, queryEnvelope, queryEnvelope2D, queryInterval, queryLooseEnvelope, querySegmentIterator, querySegmentIteratorAtVertex, removePath, removePoint, reverseAllPaths, reversePath, setAttribute, setAttribute, setEmpty, setPoint, startPath, startPath
 
Methods inherited from class com.esri.core.geometry.Geometry
addID, addM, copy, getDimensionFromType, hasAttribute, hasID, hasM, hasZ, isArea, isLinear, isMultiPath, isMultiVertex, isPoint, isSegment, queryLooseEnvelope2D
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Polygon

public Polygon()
Creates a polygon.

Method Detail

createInstance

public Geometry createInstance()
Description copied from class: Geometry
Creates an instance of an empty geometry of the same type.

Specified by:
createInstance in class Geometry

getDimension

public int getDimension()
Description copied from class: Geometry
Returns the topological dimension of the geometry object based on the geometry's type.

Returns 0 for point and multipoint.

Returns 1 for lines and polylines.

Returns 2 for polygons and envelopes

Returns 3 for objects with volume

Specified by:
getDimension in class Geometry
Returns:
Returns the integer value of the dimension of geometry.

getType

public Geometry.Type getType()
Description copied from class: Geometry
Returns the geometry type.

Specified by:
getType in class Geometry
Returns:
Returns the geometry type.

calculateRingArea2D

public double calculateRingArea2D(int ringIndex)
Calculates the ring area for this ring.

Parameters:
ringIndex - The index of this ring.
Returns:
The ring area for this ring.

isExteriorRing

public boolean isExteriorRing(int partIndex)
Returns TRUE if the ring is an exterior ring. Valid only for simple polygons.


equals

public boolean equals(Object other)
Returns TRUE when this geometry has exactly same type, properties, and coordinates as the other geometry.

Overrides:
equals in class Object

hashCode

public int hashCode()
Returns a hash code value for this polygon.

Overrides:
hashCode in class MultiPath

setXY

public void setXY(int i,
                  double x,
                  double y)
Sets a new vertex for the polygon.

Parameters:
i - The index of the new vertex.
x - The X coordinate for the new vertex.
y - The Y coordinate for the new vertex.

getExteriorRingCount

public int getExteriorRingCount()

getPoint

public void getPoint(int index,
                     Point ptOut)
Returns given vertex of the Geometry by value.


getCoordinates2D

public com.esri.core.geometry.Point2D[] getCoordinates2D()
Returns XY coordinates as an array.



Copyright © 2013. All Rights Reserved.