示例#1
0
        public void PopulateGeostationary()
        {
            var options = new GeostationaryOptions
            {
                HazeAmount        = 0.5f,
                Longitude         = 147,
                Tint              = "ff0000",
                SpatialResolution = Constants.Satellite.SpatialResolution.TwoKm,
                InterpolationType = InterpolationOptions.N,
                Force             = false,
                Verbose           = false,
                Quiet             = true
            };

            var renderOptions = OptionsParser.Populate(options);

            Assert.NotNull(renderOptions.GeostationaryRender);

            renderOptions.GeostationaryRender.Longitude.Should().Be(147);
            renderOptions.GeostationaryRender.HazeAmount.Should().Be(0.5f);
            renderOptions.InterpolationType.Should().Be(InterpolationType.NearestNeighbour);
            renderOptions.ImageSize.Should().Be(Constants.Satellite.ImageSize.TwoKm);
            renderOptions.ImageOffset.Should().Be(Constants.Satellite.Offset.TwoKm);
            renderOptions.Force.Should().BeFalse();
            renderOptions.Verbose.Should().BeFalse();
            renderOptions.Quiet.Should().BeTrue();
        }
示例#2
0
        public static RenderOptions Populate(GeostationaryOptions options)
        {
            var renderOptions = ProcessBaseOptions(options);

            renderOptions.GeostationaryRender = new GeostationaryRenderOptions(options.Longitude, options.HazeAmount);

            return(renderOptions);
        }
示例#3
0
        private static RenderOptions ParseGeostationaryOptions(GeostationaryOptions options)
        {
            var validation = new GeostationaryOptionsValidator().Validate(options);

            if (validation.IsValid)
            {
                return(OptionsParser.Populate(options));
            }

            throw new ValidationException(validation.Errors);
        }
示例#4
0
        public static RenderOptions Populate(GeostationaryOptions options)
        {
            var renderOptions = ProcessBaseOptions(options);

            renderOptions.GeostationaryRender = new GeostationaryRenderOptions(
                ToOptionalAngle(options.LongitudeDegrees),
                ToOptionalAngle(options.EndLongitudeDegrees),
                options.InverseRotation,
                options.HazeAmount,
                options.HazeOpacity);

            return(renderOptions);