Exemplo n.º 1
0
        public static bool Create(string outputPath, string[] inputPaths, GDALBuildVRTOptions options, Gdal.GDALProgressFuncDelegate progressFuncDelegate)
        {
            bool result = false;

            Dataset newDs = null;

            try {
                Gdal.SetConfigOption("GDAL_FILENAME_IS_UTF8", "NO");

                //Gdal.PushErrorHandler(GdalConfig.GdalHandlers.ErrorHandler);
                newDs = Gdal.wrapper_GDALBuildVRT_names(outputPath, inputPaths, options, progressFuncDelegate, null);
                //Gdal.PopErrorHandler();


                Gdal.SetConfigOption("GDAL_FILENAME_IS_UTF8", "YES");
            }
            catch (Exception ex)
            {
                LoggerManager.WriteErrorLog(ex.Message);
            }
            finally
            {
                if (newDs != null)
                {
                    newDs.FlushCache();
                    newDs.Dispose();

                    result = true;
                }

                Gdal.SetConfigOption("GDAL_FILENAME_IS_UTF8", "YES");
            }

            return(result);
        }
Exemplo n.º 2
0
        private bool GdalBuildVrt(string[] inputFilesPaths, string outputFilePath, string[] options, Gdal.GDALProgressFuncDelegate callback)
        {
            try
            {
                using Dataset result = Gdal.wrapper_GDALBuildVRT_names(outputFilePath, inputFilesPaths, new GDALBuildVRTOptions(options), callback, null);
            }
            catch (Exception exception)
            {
                _outputHelper.WriteLine(exception.Message);

                return(false);
            }

            return(true);
        }
Exemplo n.º 3
0
 private Dataset BuildVRT(string vrtFile, List <string> tiffFiles, GDALBuildVRTOptions vrtOptions)
 {
     return(Gdal.wrapper_GDALBuildVRT_names(vrtFile, tiffFiles.ToArray(), vrtOptions, null, null));
 }