Class SimplificationErrorCalculator.SphericalHeightAndBackpathDistanceCalculator

java.lang.Object
org.elasticsearch.geometry.simplify.SimplificationErrorCalculator.SphericalHeightAndBackpathDistanceCalculator
All Implemented Interfaces:
SimplificationErrorCalculator
Enclosing interface:
SimplificationErrorCalculator

public static class SimplificationErrorCalculator.SphericalHeightAndBackpathDistanceCalculator 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:

  1. height: y-value of middle point
  2. deltaL: -min(0, middleX - leftX)
  3. deltaR: max(0, middleX - rightX)
And the final error is: error = max(height, max(deltaL, deltaR))

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.