public class CentroidArea
extends java.lang.Object
http://www.faqs.org/faqs/graphics/algorithms-faq/
for further details of the basic approach.
The code has also be extended to handle degenerate (zero-area) polygons.
In this case, the centroid of the line segments in the polygon
will be returned.Constructor and Description |
---|
CentroidArea() |
Modifier and Type | Method and Description |
---|---|
void |
add(Coordinate[] ring)
Adds the area defined by an array of
coordinates.
|
void |
add(Geometry geom)
Adds the area defined by a Geometry to the centroid total.
|
Coordinate |
getCentroid() |
public void add(Geometry geom)
geom
- the geometry to addpublic void add(Coordinate[] ring)
ring
- an array of Coordinate
spublic Coordinate getCentroid()