java.lang.Object
org.elasticsearch.lucene.spatial.CentroidCalculator
This class keeps a running Kahan-sum of coordinates
that are to be averaged in
TriangleTreeWriter
for use
as the centroid of a shape.-
Constructor Details
-
CentroidCalculator
public CentroidCalculator()
-
-
Method Details
-
add
Add a geometry to the calculator- Parameters:
geometry
- the geometry to add
-
getX
public double getX()- Returns:
- the x-coordinate centroid
-
getY
public double getY()- Returns:
- the y-coordinate centroid
-
sumWeight
public double sumWeight()- Returns:
- the sum of all the weighted coordinates summed in the calculator
-
getDimensionalShapeType
- Returns:
- the highest dimensional shape type summed in the calculator
-