geos::geom::Polygon Class Reference

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

`#include <geos.h>`

## Public Types

typedef std::vector< const Polygon * > | ConstVect
| A vector of const Polygon pointers.

## Public Member Functions

std::unique_ptr< CoordinateSequence > | getCoordinates () const override
| Returns this Geometry vertices. Caller takes ownership of the returned object.
std::unique_ptr< Polygon > | clone () const
std::unique_ptr< Geometry > | getBoundary () const override
| Computes the boundary of this geometry.
std::string | getGeometryType () const override
| Return a string representation of this Geometry type.
GeometryTypeId | getGeometryTypeId () const override
| Return an integer representation of this Geometry type.
void | normalize () override
std::unique_ptr< Polygon > | reverse () const
double | getArea () const override
| Returns the area of this Geometry.
bool | isRectangle () const override
| Polygon overrides to check for actual rectangle.
void | orientRings (bool exteriorCW)
| Apply a ring ordering convention to this polygon, with interior rings having an opposite orientation to the specified exterior orientation.

## Protected Member Functions

Polygon * | cloneImpl () const override
| Make a deep-copy of this Geometry.
Polygon * | reverseImpl () const override
| Make a geometry with coordinates in reverse order.
int | getSortIndex () const override

## Friends

class | GeometryFactory

## Detailed Description

Represents a linear polygon, which may include holes.

The shell and holes of the polygon are represented by `LinearRing`s. 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 .

## Member Function Documentation

## clone()

std::unique_ptr< Polygon > geos::geom::Polygon::clone | ( |  | ) | const

inline

Creates and returns a full copy of this `Polygon` object. (including all coordinates contained by it).

Returns
  a clone of this instance

References cloneImpl().

## cloneImpl()

Polygon * geos::geom::Polygon::cloneImpl | ( |  | ) | const

inline override protected virtual

Make a deep-copy of this Geometry.

Implements geos::geom::Geometry.

Referenced by clone().

## getArea()

double geos::geom::Polygon::getArea | ( |  | ) | const

override virtual

Returns the area of this Geometry.

Reimplemented from geos::geom::Geometry.

## getBoundary()

std::unique_ptr< Geometry > geos::geom::Polygon::getBoundary | ( |  | ) | const

override virtual

Computes the boundary of this geometry.

Returns
  a lineal geometry (which may be empty)

See also
  Geometry::getBoundary

Implements geos::geom::Geometry.

## getCoordinates()

std::unique_ptr< CoordinateSequence > geos::geom::Polygon::getCoordinates | ( |  | ) | const

override virtual

Returns this Geometry vertices. Caller takes ownership of the returned object.

Implements geos::geom::Geometry.

## getGeometryType()

std::string geos::geom::Polygon::getGeometryType | ( |  | ) | const

override virtual

Return a string representation of this Geometry type.

Implements geos::geom::Geometry.

## getGeometryTypeId()

GeometryTypeId geos::geom::Polygon::getGeometryTypeId | ( |  | ) | const

override virtual

Return an integer representation of this Geometry type.

Implements geos::geom::Geometry.

## getSortIndex()

int geos::geom::Polygon::getSortIndex | ( |  | ) | const

inline override protected virtual

Implements geos::geom::Geometry.

## isRectangle()

bool geos::geom::Polygon::isRectangle | ( |  | ) | const

override virtual

Polygon overrides to check for actual rectangle.

Reimplemented from geos::geom::Geometry.

## normalize()

void geos::geom::Polygon::normalize | ( |  | ) |

override virtual

Reorganizes this Geometry into normal form (or canonical form). Starting point of rings is lower left, collections are ordered by geometry type, etc.

Implements geos::geom::Geometry.

References reverseImpl().

## orientRings()

void geos::geom::Polygon::orientRings | ( | bool | exteriorCW | ) |

Apply a ring ordering convention to this polygon, with interior rings having an opposite orientation to the specified exterior orientation.

Parameters

  exteriorCW | should exterior ring be clockwise?

## reverseImpl()

Polygon * geos::geom::Polygon::reverseImpl | ( |  | ) | const

override protected virtual

Make a geometry with coordinates in reverse order.

Implements geos::geom::Geometry.

Referenced by normalize().

The documentation for this class was generated from the following file:

- Polygon.h