Beispiel #1
0
        public void Test_S2CellId_DistanceFromBegin()
        {
            Assert.Equal(6, S2CellId.End(0).DistanceFromBegin());
            Assert.Equal(6 * (1L << (2 * S2.kMaxCellLevel)),
                         S2CellId.End(S2.kMaxCellLevel).DistanceFromBegin());

            Assert.Equal(0, S2CellId.Begin(0).DistanceFromBegin());
            Assert.Equal(0, S2CellId.Begin(S2.kMaxCellLevel).DistanceFromBegin());

            S2CellId id = S2CellId.FromFacePosLevel(3, 0x12345678, S2.kMaxCellLevel - 4);

            Assert.Equal(id, S2CellId.Begin(id.Level()).Advance(id.DistanceFromBegin()));
        }