GEOS 3.14.0dev
Public Types | Public Member Functions | Protected Member Functions | Friends | List of all members
geos::geom::Polygon Class Reference

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

#include <geos.h>

Inherits geos::geom::SurfaceImpl< RingType >.

Public Types

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

Public Member Functions

std::unique_ptr< CoordinateSequencegetCoordinates () const override
 Returns this Geometry vertices. Caller takes ownership of the returned object.
 
std::unique_ptr< Polygonclone () const
 
std::unique_ptr< GeometrygetBoundary () 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< Polygonreverse () 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

PolygoncloneImpl () const override
 Make a deep-copy of this Geometry.
 
PolygonreverseImpl () 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 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 .

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

◆ cloneImpl()

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

Make a deep-copy of this Geometry.

Implements geos::geom::Geometry.

◆ getArea()

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

Returns the area of this Geometry.

Reimplemented from geos::geom::Geometry.

◆ getBoundary()

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

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
overridevirtual

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

Implements geos::geom::Geometry.

◆ getGeometryType()

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

Return a string representation of this Geometry type.

Implements geos::geom::Geometry.

◆ getGeometryTypeId()

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

Return an integer representation of this Geometry type.

Implements geos::geom::Geometry.

◆ getSortIndex()

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

Implements geos::geom::Geometry.

◆ isRectangle()

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

Polygon overrides to check for actual rectangle.

Reimplemented from geos::geom::Geometry.

◆ normalize()

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

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.

◆ 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
exteriorCWshould exterior ring be clockwise?

◆ reverseImpl()

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

Make a geometry with coordinates in reverse order.

Implements geos::geom::Geometry.


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