Пример #1
0
        public void InfoNormal()
        {
            string gdalInfo = null;

            Assert.DoesNotThrowAsync(async() => gdalInfo = await GdalWorker.InfoAsync(_in4326).ConfigureAwait(false));

            Assert.False(string.IsNullOrWhiteSpace(gdalInfo));
        }
Пример #2
0
        public static async ValueTask <bool> CheckInputFileAsync(string inputFilePath, CoordinateSystem targetSystem)
        {
            // File's path checked in other methods, so checking it here is not necessary

            // Get proj and gdalInfo strings
            string projString = await GdalWorker.GetProjStringAsync(inputFilePath).ConfigureAwait(false);

            CoordinateSystem inputSystem    = GdalWorker.GetCoordinateSystem(projString);
            string           gdalInfoString = await GdalWorker.InfoAsync(inputFilePath).ConfigureAwait(false);

            // Check if input image is ready for cropping
            return(inputSystem == targetSystem &&
                   gdalInfoString.Contains(GdalWorker.Byte, StringComparison.InvariantCulture));
        }
Пример #3
0
 public void InfoNonExistantPath() => Assert.ThrowsAsync <FileNotFoundException>(async() =>
                                                                                 await GdalWorker.InfoAsync(ShouldFail).ConfigureAwait(false));
Пример #4
0
 public void InfoNullPath() => Assert.ThrowsAsync <ArgumentNullException>(async() =>
                                                                          await GdalWorker.InfoAsync(null).ConfigureAwait(false));