Пример #1
0
    public void Test_FastEncodeTaggedShapes_MixedShapes()
    {
        // Tests encoding/decoding a collection of points, polylines, and polygons.
        var index = MakeIndexOrDie(
            "0:0 | 0:1 # 1:1, 1:2, 1:3 # 2:2; 2:3, 2:4, 3:3");
        Encoder encoder = new();

        S2ShapeUtilCoding.FastEncodeTaggedShapes(index, encoder);
        index.Encode(encoder);
        var decoder = encoder.Decoder();
        MutableS2ShapeIndex decoded_index = new();

        decoded_index.Init(decoder, S2ShapeUtilCoding.FullDecodeShapeFactory(decoder));
        Assert.Equal(index.ToDebugString(), decoded_index.ToDebugString());
    }