com.vividsolutions.jts.algorithm
Class CentroidLine
java.lang.Object
com.vividsolutions.jts.algorithm.CentroidLine
public class CentroidLine
- extends Object
Computes the centroid of a linear geometry.
Algorithm
Compute the average of the midpoints
of all line segments weighted by the segment length.
- Version:
- 1.7
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
CentroidLine
public CentroidLine()
add
public void add(Geometry geom)
- Adds the linear components of by a Geometry to the centroid total.
If the geometry has no linear components it does not contribute to the centroid,
- Parameters:
geom
- the geometry to add
getCentroid
public Coordinate getCentroid()
add
public void add(Coordinate[] pts)
- Adds the length defined by an array of coordinates.
- Parameters:
pts
- an array of Coordinate
s
Copyright © 2012. All Rights Reserved.