Ejemplo n.º 1
0
        public void ShowMapWithQueryToolActive()
        {
            var mapControl = new MapControl();
            var map = new Map(new Size(1, 1));
            const string path = @"..\..\..\..\..\test-data\DeltaShell\DeltaShell.Plugins.SharpMapGis.Tests\RasterData\bodem.bil";

            var layer = new GdalRegularGridRasterLayer(path);

            map.Layers.Add(layer);
            mapControl.Map = map;

            var tool = mapControl.GetToolByType(typeof (QueryTool));
            mapControl.ActivateTool(tool);
            WindowsFormsTestHelper.ShowModal(mapControl);
        }
Ejemplo n.º 2
0
        public void ShowMapWithQueryToolActive()
        {
            var mapControl = new MapControl{ AllowDrop = false };
            var map = new Map(new Size(1, 1));
            //const string path = @"..\..\..\..\..\test-data\DeltaShell\DeltaShell.Plugins.SharpMapGis.Tests\RasterData\bodem.bil";
            const string path = @"..\..\..\..\..\test-data\DeltaShell\DeltaShell.Plugins.SharpMapGis.Tests\RasterData\test.asc";

            var layer = new GdalRegularGridRasterLayer(path);
            layer.Coverage.Components[0].NoDataValues.Add(100);

            map.Layers.Add(layer);
            mapControl.Map = map;

            var tool = mapControl.GetToolByType(typeof (QueryTool));
            mapControl.ActivateTool(tool);
            WindowsFormsTestHelper.ShowModal(mapControl);
        }
Ejemplo n.º 3
0
        public void GetCoverageValues()
        {
            var rasterDataFolderPath = TestHelper.GetTestDataPath(TestDataPath.DeltaShell.DeltaShellDeltaShellPluginsSharpMapGisTestsRasterData);
            var gridFilePath = Path.Combine(rasterDataFolderPath, "test.asc");

            var mapControl = new MapControl();
            var map = new Map();
            var layer = new GdalRegularGridRasterLayer(gridFilePath);

            map.Layers.Add(layer);
            mapControl.Map = map;

            var tool = mapControl.GetToolByType(typeof(QueryTool));
            mapControl.ActivateTool(tool);

            var noDataCellText = TypeUtils.CallPrivateMethod<string>(tool, "GetCoverageValues", new object[] {new Coordinate(25, 275)});
            Assert.AreEqual("image layer1 : No data\n", noDataCellText);

            var validDataCellText = TypeUtils.CallPrivateMethod<string>(tool, "GetCoverageValues", new object[] { new Coordinate(125, 125) });
            Assert.AreEqual("image layer1 : 50\n", validDataCellText);
        }