Class StreamingGeometrySimplifier<T extends Geometry>

java.lang.Object
org.elasticsearch.geometry.simplify.StreamingGeometrySimplifier<T>
Direct Known Subclasses:
StreamingGeometrySimplifier.LinearRingSimplifier, StreamingGeometrySimplifier.LineSimplifier, StreamingGeometrySimplifier.PolygonSimplifier

public abstract class StreamingGeometrySimplifier<T extends Geometry> extends Object
The streaming geometry simplifier can only simplify geometries composed on a single list of Points provided on a stream. This includes Line, LinearRing and Polygon (with no holes). To produce such a geometry from a stream, perform the following steps:
  • Construct the simplifier with the maximum number of points allowed, or call reset() on a previously used simplifier
  • Call consume(x, y) for each incoming point on the stream
  • Call produce() to generate the final simplified geometry of the desired type
Regardless of the number of times consume(x, y) is called, the internal state will never contain more than the stated maximum number of points (plus one for sorting), and the final geometry will be that size, or smaller (if fewer points were consumed).