Module org.elasticsearch.geo
Class SimplificationErrorCalculator.CartesianHeightAndBackpathDistanceCalculator
java.lang.Object
org.elasticsearch.geometry.simplify.SimplificationErrorCalculator.CartesianHeightAndBackpathDistanceCalculator
- All Implemented Interfaces:
SimplificationErrorCalculator
- Enclosing interface:
SimplificationErrorCalculator
public static class SimplificationErrorCalculator.CartesianHeightAndBackpathDistanceCalculator
extends Object
implements SimplificationErrorCalculator
Estimate the error as the height of the point above the base, but including support for back-paths
in the sense that of the point to be removed is father from either end than the height, we take that distance instead.
Rotate all three points such that left-right are a horizontal line on the x-axis. Then the numbers of interest are:
- height: y-value of middle point
- deltaL: -min(0, middleX - leftX)
- deltaR: max(0, middleX - rightX)
This is not a full Frechet error calculation as it does not maintain state of all removed points, only calculating the error incurred by removal of the current point, as if the current simplified line is a good enough approximation of the original line. This restriction is currently true of all the calculations implemented so far.
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.elasticsearch.geometry.simplify.SimplificationErrorCalculator
SimplificationErrorCalculator.CartesianHeightAndBackpathDistanceCalculator, SimplificationErrorCalculator.CartesianTriangleAreaCalculator, SimplificationErrorCalculator.Point3D, SimplificationErrorCalculator.PointLike, SimplificationErrorCalculator.RotationMatrix, SimplificationErrorCalculator.SphericalHeightAndBackpathDistanceCalculator, SimplificationErrorCalculator.TriangleAreaCalculator, SimplificationErrorCalculator.TriangleHeightCalculator -
Field Summary
Fields inherited from interface org.elasticsearch.geometry.simplify.SimplificationErrorCalculator
CARTESIAN_TRIANGLE_AREA, HEIGHT_AND_BACKPATH_DISTANCE, SPHERICAL_HEIGHT_AND_BACKPATH_DISTANCE, TRIANGLE_AREA, TRIANGLE_HEIGHT -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondoublecalculateError(SimplificationErrorCalculator.PointLike left, SimplificationErrorCalculator.PointLike middle, SimplificationErrorCalculator.PointLike right)
-
Constructor Details
-
CartesianHeightAndBackpathDistanceCalculator
public CartesianHeightAndBackpathDistanceCalculator()
-
-
Method Details
-
calculateError
public double calculateError(SimplificationErrorCalculator.PointLike left, SimplificationErrorCalculator.PointLike middle, SimplificationErrorCalculator.PointLike right) - Specified by:
calculateErrorin interfaceSimplificationErrorCalculator
-