Main Page | Namespace List | Class Hierarchy | Class List | File List | Namespace Members | Class Members | Related Pages

geos::Polygon Class Reference

Represents a linear polygon, which may include holes. More...

#include <geos.h>

Inheritance diagram for geos::Polygon:

geos::Geometry List of all members.

Public Member Functions

 Polygon (LinearRing *newShell, vector< Geometry * > *newHoles, const GeometryFactory *newFactory)
virtual Geometryclone () const
 Make a deep-copy of this Geometry.
CoordinateSequencegetCoordinates () const
 Returns this Geometry vertices. Caller takes ownership of the returned object.
int getNumPoints () const
 Returns the count of this Geometrys vertices.
int getDimension () const
 Returns surface dimension (2).
int getBoundaryDimension () const
 Returns 1 (Polygon boundary is a MultiLineString).
GeometrygetBoundary () const
 Returns a MultiLineString. One LineString for the shell and one for each hole. Empty for an empty Polygon.
bool isEmpty () const
 Returns whether or not the set of points in this Geometry is empty.
bool isSimple () const
 Returns false if the Geometry not simple.
const LineStringgetExteriorRing () const
 Returns the exterior ring (shell).
int getNumInteriorRing () const
 Returns number of interior rings (hole).
const LineStringgetInteriorRingN (int n) const
 Get nth interior ring (hole).
string getGeometryType () const
 Return a string representation of this Geometry type.
virtual GeometryTypeId getGeometryTypeId () const
 Return an integer representation of this Geometry type.
bool equalsExact (const Geometry *other, double tolerance) const
 Returns true if the two Geometrys are exactly equal, up to a specified tolerance.
GeometryconvexHull () const
 Returns the smallest convex Polygon that contains all the points in the Geometry.
void normalize ()
 Converts this Geometry to normal form (or canonical form).
const CoordinategetCoordinate () const
 Returns a vertex of this Geometry.
double getArea () const
 Returns the area of this Geometry.
double getLength () const
 Returns the perimeter of this Polygon.

Detailed Description

Represents a linear polygon, which may include holes.

The shell and holes of the polygon are represented by LinearRings. In a valid polygon, holes may touch the shell or other holes at a single point. However, no sequence of touching holes may split the polygon into two pieces. The orientation of the rings in the polygon does not matter.

The shell and holes must conform to the assertions specified in the OpenGIS Simple Features Specification for SQL .


Constructor & Destructor Documentation

geos::Polygon::Polygon LinearRing newShell,
vector< Geometry * > *  newHoles,
const GeometryFactory newFactory
 

Constructs a Polygon with the given exterior and interior boundaries.

Parameters:
newShell the outer boundary of the new Polygon, or null or an empty LinearRing if the empty geometry is to be created.
newHoles the LinearRings defining the inner boundaries of the new Polygon, or null or empty LinearRing if the empty geometry is to be created.
newFactory the GeometryFactory used to create this geometry
Polygon will take ownership of Shell and Holes LinearRings


Member Function Documentation

double geos::Polygon::getArea  )  const [virtual]
 

Returns the area of this Geometry.

Returns the area of this Geometry. Areal Geometries have a non-zero area. They override this function to compute the area. Others return 0.0

Returns:
the area of the Geometry

Reimplemented from geos::Geometry.

double geos::Polygon::getLength  )  const [virtual]
 

Returns the perimeter of this Polygon.

Returns the perimeter of this Polygon

Returns:
the perimeter of the polygon

Reimplemented from geos::Geometry.


The documentation for this class was generated from the following files:
Generated on Thu Jun 10 12:43:54 2010 for GEOS by  doxygen 1.3.9.1