Exemplo n.º 1
0
        public void InfoNormal()
        {
            string gdalInfo = null;

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

            Assert.False(string.IsNullOrWhiteSpace(gdalInfo));
        }
Exemplo n.º 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));
        }
Exemplo n.º 3
0
 public void InfoNonExistantPath() => Assert.ThrowsAsync <FileNotFoundException>(async() =>
                                                                                 await GdalWorker.InfoAsync(ShouldFail).ConfigureAwait(false));
Exemplo n.º 4
0
 public void InfoNullPath() => Assert.ThrowsAsync <ArgumentNullException>(async() =>
                                                                          await GdalWorker.InfoAsync(null).ConfigureAwait(false));