JTS Topology Suite version 1.12

com.vividsolutions.jts.algorithm
Class CentroidPoint

java.lang.Object
  extended by com.vividsolutions.jts.algorithm.CentroidPoint

public class CentroidPoint
extends java.lang.Object

Computes the centroid of a point geometry.

Algorithm

Compute the average of all points.

Version:
1.7

Constructor Summary
CentroidPoint()
           
 
Method Summary
 void add(Coordinate pt)
          Adds the length defined by an array of coordinates.
 void add(Geometry geom)
          Adds the point(s) defined by a Geometry to the centroid total.
 Coordinate getCentroid()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CentroidPoint

public CentroidPoint()
Method Detail

add

public void add(Geometry geom)
Adds the point(s) defined by a Geometry to the centroid total. If the geometry is not of dimension 0 it does not contribute to the centroid.

Parameters:
geom - the geometry to add

add

public void add(Coordinate pt)
Adds the length defined by an array of coordinates.

Parameters:
pts - an array of Coordinates

getCentroid

public Coordinate getCentroid()

JTS Topology Suite version 1.12