GEOS
3.14.0dev
|
Computes the centroid of a Geometry of any dimension. More...
#include <Centroid.h>
Public Member Functions | |
Centroid (const geom::Geometry &geom) | |
Creates a new instance for computing the centroid of a geometry. | |
bool | getCentroid (geom::CoordinateXY ¢) const |
Gets the computed centroid. More... | |
Static Public Member Functions | |
static bool | getCentroid (const geom::Geometry &geom, geom::CoordinateXY ¢) |
Computes the centroid point of a geometry. More... | |
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.
If the input geometries are empty, a null
Coordinate is returned.
|
static |
Computes the centroid point of a geometry.
geom | the geometry to use |
cent | will be set to the centroid point, if any |
true
if a centroid could be computed, false
otherwise (empty geom) bool geos::algorithm::Centroid::getCentroid | ( | geom::CoordinateXY & | cent | ) | const |
Gets the computed centroid.
cent | will be set to the centroid point, if any |
true
if a centroid could be computed, false
otherwise (empty geom)