コード例 #1
0
        public void SetOpExtentTest()
        {
            FakeRaster <int> Raster1 = new FakeRaster <int>(0, 0, -1, 1, new int[, ] {
                { 0, 1, 2, -999 },
                { 3, 4, 5, -999 },
                { 6, 7, 8, -999 },
                { 0, 1, 2, -999 },
                { 3, 4, 5, -999 },
                { 6, 7, 8, -999 },
                { 0, 1, 2, -999 },
                { 3, 4, 5, -999 },
                { 6, 7, 8, -999 },
                { 0, 1, 2, -999 },
                { 3, 4, 5, -999 },
                { 6, 7, 8, -999 }
            });

            int[,] output = new int[, ] {
                { 0, 0, 0, 0 }, { 0, 0, 0, 0 }, { 0, 0, 0, 0 }, { 0, 0, 0, 0 }, { 0, 0, 0, 0 }, { 0, 0, 0, 0 }, { 0, 0, 0, 0 }, { 0, 0, 0, 0 }, { 0, 0, 0, 0 }, { 0, 0, 0, 0 }, { 0, 0, 0, 0 }, { 0, 0, 0, 0 }
            };

            Raster rOutput3 = new FakeRaster <int>(0, 0, -1, 1, new int[, ] {
                { 0, 0, 0, 0 }, { 0, 0, 0, 0 }, { 0, 0, 0, 0 }
            });
            TestWOOOp <int> theTest3 = new TestWOOOp <int>(new List <Raster> {
                Raster1
            }, 3, rOutput3);

            theTest3.BuffOpExtent(5);
        }
コード例 #2
0
        public void WindowOverlapOperatorTest()
        {
            FakeRaster <int> Raster1 = new FakeRaster <int>(0, 0, -1, 1, new int[, ] {
                { 0, 1, 2, -999 },
                { 3, 4, 5, -999 },
                { 6, 7, 8, -999 },
                { 0, 1, 2, -999 },
                { 3, 4, 5, -999 },
                { 6, 7, 8, -999 },
                { 0, 1, 2, -999 },
                { 3, 4, 5, -999 },
                { 6, 7, 8, -999 },
                { 0, 1, 2, -999 },
                { 3, 4, 5, -999 },
                { 6, 7, 8, -999 }
            });

            int[,] output = new int[, ] {
                { 0, 0, 0, 0 }, { 0, 0, 0, 0 }, { 0, 0, 0, 0 }, { 0, 0, 0, 0 }, { 0, 0, 0, 0 }, { 0, 0, 0, 0 }, { 0, 0, 0, 0 }, { 0, 0, 0, 0 }, { 0, 0, 0, 0 }, { 0, 0, 0, 0 }, { 0, 0, 0, 0 }, { 0, 0, 0, 0 }
            };

            Raster          rOutput1 = new FakeRaster <int>(0, 0, -1, 1, output);
            TestWOOOp <int> theTest1 = new TestWOOOp <int>(new List <Raster> {
                Raster1
            }, 1, rOutput1);

            theTest1.RunWithOutput();
            CollectionAssert.AreEqual(Raster1._inputgrid, ((FakeRaster <int>)rOutput1)._outputGrid);

            Raster          rOutput2 = new FakeRaster <int>(0, 0, -1, 1, output);
            TestWOOOp <int> theTest2 = new TestWOOOp <int>(new List <Raster> {
                Raster1
            }, 2, rOutput2);

            theTest2.RunWithOutput();
            CollectionAssert.AreEqual(Raster1._inputgrid, ((FakeRaster <int>)rOutput2)._outputGrid);

            Raster          rOutput3 = new FakeRaster <int>(0, 0, -1, 1, output);
            TestWOOOp <int> theTest3 = new TestWOOOp <int>(new List <Raster> {
                Raster1
            }, 3, rOutput3);

            theTest3.RunWithOutput();
            CollectionAssert.AreEqual(Raster1._inputgrid, ((FakeRaster <int>)rOutput3)._outputGrid);
        }