예제 #1
0
        public void CreateMultipleDemPlatesFromPyramidsTest()
        {
            int    levels         = 5;
            string testFolderName = Path.Combine(TestDataPath, "CreateMultipleDemPlatesFromPyramidsTest", "TestDemMultiplePlateFolder");

            MockClasses.MockMultipleDemTileLocator tileLocator = new MockClasses.MockMultipleDemTileLocator();

            MultipleDemPlateFileGenerator target = new MultipleDemPlateFileGenerator(testFolderName, levels);

            target.CreateFromDemTile(tileLocator);

            WtmlCollection collection = new WtmlCollection("test", "Test.jpeg", "testtexture", levels, ProjectionTypes.Mercator);

            collection.Save(Path.Combine(TestDataPath, "CreateMultipleDemPlatesFromPyramidsTest", "CreateMultipleDemPlatesFromPyramidsTest.wtml"));

            Assert.IsTrue(Directory.Exists(testFolderName));
            Assert.IsTrue(File.Exists(Path.Combine(testFolderName, "DL0X0Y0.plate")));

            Assert.IsTrue(Directory.Exists(Path.Combine(testFolderName, "2")));
            Assert.AreEqual(16, Directory.GetFiles(Path.Combine(testFolderName, "2"), "*.plate").Length);

            ValidatePyramid(testFolderName, tileLocator, 0, 0, 0);
            ValidatePyramid(testFolderName, tileLocator, 2, 0, 0);
            ValidatePyramid(testFolderName, tileLocator, 3, 1, 1);
            ValidatePyramid(testFolderName, tileLocator, 5, 6, 6);
        }
예제 #2
0
        public void MultipleDemPlateFileGeneratorConstructorTest()
        {
            string folderPath = TestDataPath;
            int    levels     = 5;

            MultipleDemPlateFileGenerator multiplePlateFileGen = new MultipleDemPlateFileGenerator(folderPath, levels);

            privateObject = new PrivateObject(multiplePlateFileGen);
            MultiplePlateFileDetails field = (MultiplePlateFileDetails)privateObject.GetField("plateFileDetails");

            Assert.AreEqual(4, field.LevelsPerPlate);
            Assert.AreEqual(3, field.MaxOverlappedLevel);
            Assert.AreEqual(2, field.MinOverlappedLevel);
            Assert.AreEqual(2, field.TotalOverlappedLevels);
        }
예제 #3
0
        public void CreateMultipleDemPlatesFromPyramidsTest()
        {
            int levels = 5;
            string testFolderName = Path.Combine(TestDataPath, "CreateMultipleDemPlatesFromPyramidsTest", "TestDemMultiplePlateFolder");
            MockClasses.MockMultipleDemTileLocator tileLocator = new MockClasses.MockMultipleDemTileLocator();

            MultipleDemPlateFileGenerator target = new MultipleDemPlateFileGenerator(testFolderName, levels);
            target.CreateFromDemTile(tileLocator);

            WtmlCollection collection = new WtmlCollection("test", "Test.jpeg", "testtexture", levels, ProjectionTypes.Mercator);
            collection.Save(Path.Combine(TestDataPath, "CreateMultipleDemPlatesFromPyramidsTest", "CreateMultipleDemPlatesFromPyramidsTest.wtml"));

            Assert.IsTrue(Directory.Exists(testFolderName));
            Assert.IsTrue(File.Exists(Path.Combine(testFolderName, "DL0X0Y0.plate")));

            Assert.IsTrue(Directory.Exists(Path.Combine(testFolderName, "2")));
            Assert.AreEqual(16, Directory.GetFiles(Path.Combine(testFolderName, "2"), "*.plate").Length);

            ValidatePyramid(testFolderName, tileLocator, 0, 0, 0);
            ValidatePyramid(testFolderName, tileLocator, 2, 0, 0);
            ValidatePyramid(testFolderName, tileLocator, 3, 1, 1);
            ValidatePyramid(testFolderName, tileLocator, 5, 6, 6);
        }
예제 #4
0
        public void MultipleDemPlateFileGeneratorConstructorTest()
        {
            string folderPath = TestDataPath;
            int levels = 5;

            MultipleDemPlateFileGenerator multiplePlateFileGen = new MultipleDemPlateFileGenerator(folderPath, levels);
            privateObject = new PrivateObject(multiplePlateFileGen);
            MultiplePlateFileDetails field = (MultiplePlateFileDetails)privateObject.GetField("plateFileDetails");

            Assert.AreEqual(4, field.LevelsPerPlate);
            Assert.AreEqual(3, field.MaxOverlappedLevel);
            Assert.AreEqual(2, field.MinOverlappedLevel);
            Assert.AreEqual(2, field.TotalOverlappedLevels);
        }