Пример #1
0
        public void Test_ShapeIndexTarget_UpdateMinDistanceToCellWhenEqual()
        {
            var target_index = MakeIndexOrDie("1:0 # #");
            var target       = new S2MinDistanceShapeIndexTarget(target_index);
            var dist         = S1ChordAngle.Infinity;
            var cell         = new S2Cell(new S2CellId(MakePointOrDie("0:0")));

            Assert.True(target.UpdateMinDistance(cell, ref dist));
            Assert.False(target.UpdateMinDistance(cell, ref dist));
        }
Пример #2
0
        public void Test_ShapeIndexTarget_UpdateMinDistanceToEdgeWhenEqual()
        {
            var target_index = MakeIndexOrDie("1:0 # #");
            var target       = new S2MinDistanceShapeIndexTarget(target_index);
            var dist         = S1ChordAngle.Infinity;
            var edge         = ParsePointsOrDie("0:-1, 0:1");

            Assert.True(target.UpdateMinDistance(edge[0], edge[1], ref dist));
            Assert.False(target.UpdateMinDistance(edge[0], edge[1], ref dist));
        }