public class Centroid extends Object
Geometry
of any dimension.
If the geometry is nominally of higher dimension,
but has lower effective dimension
(i.e. contains only components
having zero length or area),
the centroid will be computed as for the equivalent lower-dimension geometry.
If the input geometry is empty, a
null
Coordinate is returned.
http://www.faqs.org/faqs/graphics/algorithms-faq/
for further details of the basic approach.
Constructor and Description |
---|
Centroid(Geometry geom)
Creates a new instance for computing the centroid of a geometry
|
Modifier and Type | Method and Description |
---|---|
Coordinate |
getCentroid()
Gets the computed centroid.
|
static Coordinate |
getCentroid(Geometry geom)
Computes the centroid point of a geometry.
|
public Centroid(Geometry geom)
public static Coordinate getCentroid(Geometry geom)
geom
- the geometry to usepublic Coordinate getCentroid()
Copyright © 2020. All rights reserved.