예제 #1
0
        public void CheckThemeOfCoverageWithoutValidValues()
        {
            var coverage = new RegularGridCoverage(2, 2, 10, 10);

            coverage.Components[0].Clear();
            coverage.SetValues(new[] { -999.0, -999.0, double.PositiveInfinity, double.NaN },
                               new VariableValueFilter <double>(coverage.X, new double[] { 0, 1 }),
                               new VariableValueFilter <double>(coverage.Y, new double[] { 0, 1 })
                               );

            coverage.Components[0].NoDataValues.Add(-999.0);

            var layer = new RegularGridCoverageLayer {
                Coverage = coverage
            };

            layer.Map      = new Map(new Size(10, 10));
            layer.Map.Zoom = layer.Map.Zoom / 100;

            layer.Render();

            var gradientTheme = layer.Theme as GradientTheme;

            Assert.IsNotNull(gradientTheme);

            Assert.AreEqual(double.MinValue, gradientTheme.Min);
            Assert.AreEqual(double.MaxValue, gradientTheme.Max);
        }
예제 #2
0
        public void ClearingCoverageCauseRenderRequired()
        {
            var coverage = new RegularGridCoverage(10, 10, 1, 1);
            var layer    = new RegularGridCoverageLayer {
                Coverage = coverage
            };

            layer.Map = new Map(new Size(10, 10));
            layer.Render();
            Assert.IsFalse(layer.RenderRequired);

            //action!
            coverage.Clear();

            Assert.IsTrue(layer.RenderRequired);
        }