Ejemplo n.º 1
0
        public void Test_S2RegionEncodeDecodeTest_S2CellUnion()
        {
            S2CellUnion cu_empty = new();
            S2CellUnion cu_face1 = new(new List <S2CellId> {
                S2CellId.FromFace(1)
            });
            // Cell ids taken from S2CellUnion EncodeDecode test.
            S2CellUnion cu_latlngs = S2CellUnion.FromNormalized(new List <S2CellId>
            {
                new S2CellId(0x33),
                new S2CellId(0x8e3748fab),
                new S2CellId(0x91230abcdef83427),
            });

            var cu = TestEncodeDecode(kEncodedCellUnionEmpty, cu_empty);

            Assert.Equal(cu_empty, cu);
            cu = TestEncodeDecode(kEncodedCellUnionFace1, cu_face1);
            Assert.Equal(cu_face1, cu);
            cu = TestEncodeDecode(kEncodedCellUnionFromCells, cu_latlngs);
            Assert.Equal(cu_latlngs, cu);
        }