org.kaboum.geom
Class KaboumPolygon

java.lang.Object
  extended by org.kaboum.geom.KaboumGeometry
      extended by org.kaboum.geom.KaboumPolygon

public class KaboumPolygon
extends KaboumGeometry

Basic implementation of Polygon.


Field Summary
protected  KaboumLinearRing[] holes
          The interior boundaries, if any.
protected  KaboumLinearRing shell
          The exterior boundary
 
Fields inherited from class org.kaboum.geom.KaboumGeometry
WKT_LINESTRING, WKT_POINT, WKT_POLYGON
 
Constructor Summary
KaboumPolygon(KaboumLinearRing shell)
          Constructs a Polygon with the given exterior boundary.
KaboumPolygon(KaboumLinearRing shell, KaboumLinearRing[] holes)
          Constructs a Polygon with the given exterior boundary and interior boundaries.
 
Method Summary
 void addCoordinate(KaboumCoordinate internal)
           
 void addCoordinateInHoleN(KaboumCoordinate internal, int i)
           
 java.lang.Object clone()
          Perform an exact copy of this object
protected  KaboumExtent computeExtentInternal()
           
 boolean equalsExact(KaboumGeometry other)
           
 double getArea()
          Compute area for this polygon
 KaboumCoordinate[] getCoordinates()
          Returns this Geometry s vertices.
 int getDimension()
           
 KaboumExtent getExtent()
           
 KaboumCoordinate[] getExteriorCoordinates()
          Returns this Geometry s exterior vertices.
 int getExteriorNumPoints()
           
 KaboumLineString getExteriorRing()
           
 java.lang.String getGeometryType()
           
 KaboumLineString getInteriorRingN(int n)
           
 int getNumInteriorRing()
           
 int getNumPoints()
          Returns the count of this Geometrys vertices.
 double getPerimeter()
          Compute perimeter for this polygon
 boolean isClosed()
           
 boolean isEmpty()
           
 void normalize()
           
 boolean setCoordinates(KaboumCoordinate[] internals)
          By default, adding coordinates to a Polygon is equivalent to adding coordinates to the shell
 void setHoles(KaboumLinearRing[] _holes)
           
 
Methods inherited from class org.kaboum.geom.KaboumGeometry
addCoordinateInGeometryN, getGeometryN, getNumGeometries, hasNonEmptyElements, hasNullElements, indexOf, isEquivalentClass, minCoordinate, removeGeometry, reversePointOrder, scroll
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

shell

protected KaboumLinearRing shell
The exterior boundary


holes

protected KaboumLinearRing[] holes
The interior boundaries, if any.

Constructor Detail

KaboumPolygon

public KaboumPolygon(KaboumLinearRing shell)
Constructs a Polygon with the given exterior boundary. The shell and holes must conform to the assertions specified in the OpenGIS Simple Features Specification for SQL.

Parameters:
shell - the outer boundary of the new Polygon. Must be oriented clockwise.

KaboumPolygon

public KaboumPolygon(KaboumLinearRing shell,
                     KaboumLinearRing[] holes)
Constructs a Polygon with the given exterior boundary and interior boundaries.

Parameters:
shell - the outer boundary of the new Polygon. Must be oriented clockwise.
holes - the inner boundaries of the new Polygon. Each must be oriented counterclockwise.
Method Detail

getCoordinates

public KaboumCoordinate[] getCoordinates()
Description copied from class: KaboumGeometry
Returns this Geometry s vertices.

Specified by:
getCoordinates in class KaboumGeometry
Returns:
the vertices of this Geometry

getExteriorCoordinates

public KaboumCoordinate[] getExteriorCoordinates()
Description copied from class: KaboumGeometry
Returns this Geometry s exterior vertices.

Specified by:
getExteriorCoordinates in class KaboumGeometry
Returns:
the vertices of this Geometry

setCoordinates

public boolean setCoordinates(KaboumCoordinate[] internals)
By default, adding coordinates to a Polygon is equivalent to adding coordinates to the shell

Specified by:
setCoordinates in class KaboumGeometry
Returns:
the vertices of this Geometry

getNumPoints

public int getNumPoints()
Description copied from class: KaboumGeometry
Returns the count of this Geometrys vertices.

Specified by:
getNumPoints in class KaboumGeometry
Returns:
the number of vertices in this Geometry

getExteriorNumPoints

public int getExteriorNumPoints()
Specified by:
getExteriorNumPoints in class KaboumGeometry

getDimension

public int getDimension()
Specified by:
getDimension in class KaboumGeometry

isEmpty

public boolean isEmpty()
Specified by:
isEmpty in class KaboumGeometry

getExteriorRing

public KaboumLineString getExteriorRing()

getNumInteriorRing

public int getNumInteriorRing()

getInteriorRingN

public KaboumLineString getInteriorRingN(int n)

getGeometryType

public java.lang.String getGeometryType()
Specified by:
getGeometryType in class KaboumGeometry

computeExtentInternal

protected KaboumExtent computeExtentInternal()

equalsExact

public boolean equalsExact(KaboumGeometry other)
Specified by:
equalsExact in class KaboumGeometry

clone

public java.lang.Object clone()
Description copied from class: KaboumGeometry
Perform an exact copy of this object

Overrides:
clone in class KaboumGeometry

normalize

public void normalize()
Specified by:
normalize in class KaboumGeometry

isClosed

public boolean isClosed()
Specified by:
isClosed in class KaboumGeometry

getExtent

public KaboumExtent getExtent()
Specified by:
getExtent in class KaboumGeometry

getArea

public double getArea()
Compute area for this polygon

Specified by:
getArea in class KaboumGeometry

getPerimeter

public double getPerimeter()
Compute perimeter for this polygon

Specified by:
getPerimeter in class KaboumGeometry

addCoordinate

public void addCoordinate(KaboumCoordinate internal)
Overrides:
addCoordinate in class KaboumGeometry

addCoordinateInHoleN

public void addCoordinateInHoleN(KaboumCoordinate internal,
                                 int i)

setHoles

public void setHoles(KaboumLinearRing[] _holes)


Copyright © 2005 Kaboum team. All Rights Reserved.