org.geotools.geometry.iso.util.algorithmND
Class CentroidPoint

java.lang.Object
  extended by org.geotools.geometry.iso.util.algorithmND.CentroidPoint

public class CentroidPoint
extends java.lang.Object

Computes the centroid of a point geometry.

Algorithm

Compute the average of all points.


Constructor Summary
CentroidPoint(org.opengis.referencing.crs.CoordinateReferenceSystem crs)
          Creates a new Centroid operation
 
Method Summary
 void add(GeometryImpl geom)
          Adds the point(s) defined by a Geometry to the centroid total.
 DirectPositionImpl getCentroid()
          Returns the centroid of the added points
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CentroidPoint

public CentroidPoint(org.opengis.referencing.crs.CoordinateReferenceSystem crs)
Creates a new Centroid operation

Parameters:
crs -
Method Detail

add

public void add(GeometryImpl 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 DirectPositionImpl getCentroid()
Returns the centroid of the added points

Returns:
Centroid position


Copyright © 1996-2010 Geotools. All Rights Reserved.