com.vividsolutions.jts.algorithm

Class CentroidPoint


public class CentroidPoint
extends java.lang.Object

Computes the centroid of a point geometry.

Algorithm

Compute the average of all points.
Version:
1.6

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()

Constructor Details

CentroidPoint

public CentroidPoint()

Method Details

add

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

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

getCentroid

public Coordinate getCentroid()