Exemplo n.º 1
0
        public void Test_S2CellUnion_UnsortedCellsNotValid()
        {
            var id         = new S2CellId(new S2Point(1, 0, 0)).Parent(10);
            var cell_union = FromVerbatimNoChecks(new List <S2CellId> {
                id, id.Prev()
            });

            Assert.False(cell_union.IsValid());
        }
Exemplo n.º 2
0
 public void Test_EncodedS2PointVectorTest_LastTwoPointsAtAllLevels()
 {
     // Test encoding the last two S2CellIds at each level.
     for (int level = 0; level <= S2.kMaxCellLevel; ++level)
     {
         _logger.WriteLine("Level = " + level);
         S2CellId id = S2CellId.End(level).Prev();
         // Notice that this costs only 4 bits more than encoding the last S2CellId
         // by itself (see LastAtAllLevels).  This is because encoding a block of
         // size 1 uses 8-bit deltas (which reduces the size of "base" by 4 bits),
         // while this test uses two 4-bit deltas.
         int expected_size = 6 + (level + 2) / 4;
         TestEncodedS2PointVector(new S2Point[] { id.ToPoint(), id.Prev().ToPoint() },
                                  CodingHint.COMPACT, expected_size);
     }
 }