Exemplo n.º 1
0
        public void WarpNullOutput()
        {
            _gdalWarpOptions.AddRange(GdalWorker.SrsEpsg3857);

            Assert.ThrowsAsync <ArgumentNullException>(async() =>
                                                       await GdalWorker.WarpAsync(_in4326, null, _gdalWarpOptions.ToArray(), _progress).ConfigureAwait(false));
        }
Exemplo n.º 2
0
        public void WarpNonExistingInput()
        {
            _gdalWarpOptions.AddRange(GdalWorker.SrsEpsg3857);

            Assert.ThrowsAsync <FileNotFoundException>(async() =>
                                                       await GdalWorker.WarpAsync(ShouldFail, _outPath, _gdalWarpOptions.ToArray(), _progress).ConfigureAwait(false));
        }
Exemplo n.º 3
0
        public void Warp4326To3857()
        {
            _gdalWarpOptions.AddRange(GdalWorker.SrsEpsg3857);

            Assert.DoesNotThrowAsync(async() =>
            {
                await GdalWorker.WarpAsync(_in4326, _outPath, _gdalWarpOptions.ToArray(), _progress).ConfigureAwait(false);

                CheckHelper.CheckFile(_outPath);
            });

            File.Delete(_outPath);
        }
Exemplo n.º 4
0
        public void WarpExistingOutput()
        {
            FileStream fs = File.Create(_outPath);

            // Must dispose explicitly to delete correctly
            fs.Dispose();

            _gdalWarpOptions.AddRange(GdalWorker.SrsEpsg3857);

            Assert.ThrowsAsync <FileException>(async() =>
                                               await GdalWorker.WarpAsync(_in4326, _outPath, _gdalWarpOptions.ToArray(), _progress).ConfigureAwait(false));

            File.Delete(_outPath);
        }
Exemplo n.º 5
0
 public void WarpNullOptions() => Assert.ThrowsAsync <ArgumentNullException>(async() =>
                                                                             await GdalWorker.WarpAsync(_in4326, _outPath, null, _progress).ConfigureAwait(false));