Class S2PointCompression


  • @GwtCompatible
    public final class S2PointCompression
    extends Object
    • Method Detail

      • encodePointsCompressed

        public static void encodePointsCompressed​(List<S2Point> points,
                                                  int level,
                                                  OutputStream output)
                                           throws IOException
        Encode a list of points into an efficient, lossless binary representation, which can be decoded by calling decodePointsCompressed(int, int, java.io.InputStream). The encoding is byte-compatible with the C++ version of the S2 library.

        Points that are snapped to the specified level will require approximately 4 bytes per point, while other points will require 24 bytes per point.

        Parameters:
        points - The list of points to encode.
        level - The S2Cell level at which points should be encoded.
        output - The output stream into which the encoding should be written.
        Throws:
        IOException - if there was a problem writing into the output stream.