com.vividsolutions.jts.algorithm
Class CentroidLine
java.lang.Object
com.vividsolutions.jts.algorithm.CentroidLine
public class CentroidLine
extends java.lang.Object
Computes the centroid of a linear geometry.
Algorithm
Compute the average of the midpoints
of all line segments weighted by the segment length.
CentroidLine
public CentroidLine()
add
public void add(Coordinate[] pts)
Adds the length defined by an array of coordinates.
add
public void add(Geometry geom)
Adds the linestring(s) defined by a Geometry to the centroid total.
If the geometry is not linear it does not contribute to the centroid
geom
- the geometry to add