Package org.meteoinfo.jts.algorithm
Class CentroidArea
- java.lang.Object
-
- org.meteoinfo.jts.algorithm.CentroidArea
-
Deprecated.use Centroid instead
public class CentroidArea extends java.lang.ObjectComputes the centroid of an area geometry.Algorithm
Based on the usual algorithm for calculating the centroid as a weighted sum of the centroids of a decomposition of the area into (possibly overlapping) triangles. The algorithm has been extended to handle holes and multi-polygons. Seehttp://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 Summary
Constructors Constructor Description CentroidArea()Deprecated.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description voidadd(Coordinate[] ring)Deprecated.Adds the area defined by an array of coordinates.voidadd(Geometry geom)Deprecated.Adds the area defined by a Geometry to the centroid total.CoordinategetCentroid()Deprecated.
-
-
-
Method Detail
-
add
public void add(Geometry geom)
Deprecated.Adds the area defined by a Geometry to the centroid total. If the geometry has no area it does not contribute to the centroid.- Parameters:
geom- the geometry to add
-
add
public void add(Coordinate[] ring)
Deprecated.Adds the area defined by an array of coordinates. The array must be a ring; i.e. end with the same coordinate as it starts with.- Parameters:
ring- an array ofCoordinates
-
getCentroid
public Coordinate getCentroid()
Deprecated.
-
-