Esempio n. 1
0
        public void GetImageBordersOtherCs()
        {
            using Image image = Image.NewFromFile(_in4326);
            Size size = new Size(image.Width, image.Height);

            Assert.Throws <NotSupportedException>(() => GdalWorker.GetImageBorders(_in4326, size, CsOther));
        }
Esempio n. 2
0
        public void GetImageBordersNullSize()
        {
            string           proj = GdalWorker.GetProjString(_in4326);
            CoordinateSystem cs   = GdalWorker.GetCoordinateSystem(proj);

            Assert.Throws <ArgumentNullException>(() => GdalWorker.GetImageBorders(_in4326, null, cs));
        }
Esempio n. 3
0
        public void GetImageBordersNonExistingPath()
        {
            using Image image = Image.NewFromFile(_in4326);
            Size             size = new Size(image.Width, image.Height);
            string           proj = GdalWorker.GetProjString(_in4326);
            CoordinateSystem cs   = GdalWorker.GetCoordinateSystem(proj);

            Assert.Throws <FileNotFoundException>(() => GdalWorker.GetImageBorders(ShouldFail, size, cs));
        }
Esempio n. 4
0
        public void GetImageBordersNullPath()
        {
            using Image image = Image.NewFromFile(_in4326);
            Size             size = new Size(image.Width, image.Height);
            string           proj = GdalWorker.GetProjString(_in4326);
            CoordinateSystem cs   = GdalWorker.GetCoordinateSystem(proj);

            Assert.Throws <ArgumentNullException>(() => GdalWorker.GetImageBorders(null, size, cs));
        }
Esempio n. 5
0
        public void GetImageBordersNormal()
        {
            using Image image = Image.NewFromFile(_in4326);
            Size             size = new Size(image.Width, image.Height);
            string           proj = GdalWorker.GetProjString(_in4326);
            CoordinateSystem cs   = GdalWorker.GetCoordinateSystem(proj);

            GeoCoordinate minCoordinate = null;
            GeoCoordinate maxCoordinate = null;

            Assert.DoesNotThrow(() => (minCoordinate, maxCoordinate) = GdalWorker.GetImageBorders(_in4326, size, cs));
            Assert.True(minCoordinate is GeodeticCoordinate && maxCoordinate is GeodeticCoordinate);
        }
Esempio n. 6
0
        public void GetImageBordersWrongCs2()
        {
            using Image image = Image.NewFromFile(_in3785);
            Size size = new Size(image.Width, image.Height);

            Assert.Throws <ArgumentOutOfRangeException>(() =>
            {
                (GeoCoordinate minCoordinate, GeoCoordinate maxCoordinate) = GdalWorker.GetImageBorders(_in3785, size, Cs4326);

                // Pass the tests too
                if (!(minCoordinate is MercatorCoordinate && maxCoordinate is MercatorCoordinate))
                {
                    throw new ArgumentOutOfRangeException();
                }
            });
        }