GEOS  3.8.0dev
Public Member Functions | Static Public Member Functions | List of all members
geos::algorithm::Centroid Class Reference

#include <Centroid.h>

Public Member Functions

 Centroid (const geom::Geometry &geom)
 
bool getCentroid (geom::Coordinate &cent) const
 

Static Public Member Functions

static bool getCentroid (const geom::Geometry &geom, geom::Coordinate &cent)
 

Detailed Description

Computes the centroid of a Geometry of any dimension. If the geometry is nomimally of higher dimension, but contains only components having a lower effective dimension (i.e. zero length or area), the centroid will be computed appropriately.

Algorithm

If the input geometries are empty, a null Coordinate is returned.

Constructor & Destructor Documentation

geos::algorithm::Centroid::Centroid ( const geom::Geometry geom)
inline

Creates a new instance for computing the centroid of a geometry

Member Function Documentation

static bool geos::algorithm::Centroid::getCentroid ( const geom::Geometry geom,
geom::Coordinate cent 
)
static

Computes the centroid point of a geometry.

Parameters
geomthe geometry to use
centwill be set to the centroid point, if any
Returns
true if a centroid could be computed, false otherwise (empty geom)
bool geos::algorithm::Centroid::getCentroid ( geom::Coordinate cent) const

Gets the computed centroid.

Parameters
centwill be set to the centroid point, if any
Returns
true if a centroid could be computed, false otherwise (empty geom)

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