Class S2ShapeIndexCoder

java.lang.Object
com.google.common.geometry.S2ShapeIndexCoder
All Implemented Interfaces:
S2Coder<S2ShapeIndex>

@GwtIncompatible("S2LaxPolylineShape and S2LaxPolygonShape") public class S2ShapeIndexCoder extends Object implements S2Coder<S2ShapeIndex>
An encoder/decoder of S2ShapeIndexs.

Values from the S2ShapeIndex returned by decode(Bytes, Cursor) are decoded only when they are accessed. This allows for very fast initialization and no additional memory use beyond the encoded data, and a cache of the clipped shapes that have been accessed. When accessing the entire index, this uses slightly more memory than S2ShapeIndex, but uses dramatically less memory when accessing only a few cells of the index.