Overview | Package | Class | Tree | Deprecated | Index | Help
| JTS Topology Suite - v 1.12
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.vividsolutions.jts.algorithm
Class CentroidPoint

    java.lang.Object
      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 `Coordinate`s

### getCentroid

    public Coordinate getCentroid()

Overview | Package | Class | Tree | Deprecated | Index | Help
| JTS Topology Suite - v 1.12
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD