[gdal-dev] Issue with using GDAL warp

Ian Hannah Ian.Hannah at metasphere.co.uk
Sun Mar 24 11:51:18 PDT 2024


Hi,

I am using 3.8.4  of GDAL .NET and running this code:

                    string[] warpOptions =
                    {
                        "outputType", GdalConst.GDT_Byte.ToString(),
                        "srcSRS", projectionWKT,
                        "dstSRS", "EPSG:3857",
                        "accessMode", "overwrite"
                    };

                    string geoTiffOutputFileName = Path.GetTempFileName();
                    string pngOutputFileName = convertToImage ? Path.GetTempFileName() : null;

                    try
                    {
                        GDALVectorTranslateOptions gdalWarpOptions = new GDALVectorTranslateOptions(warpOptions);

                        using (Dataset outputDataset = Gdal.wrapper_GDALVectorTranslateDestName(geoTiffOutputFileName, dataset, gdalWarpOptions, null, null))
                        {
                            if (convertToImage)
                            {
                                string[] translateOptions = { "-of", "PNG" };
                                using (Gdal.wrapper_GDALTranslate(pngOutputFileName, outputDataset, new GDALTranslateOptions(translateOptions), null, null)) { }
                            }
                        }
                  }

And on the call to Gdal.wrapper_GDALVectorTranslateDestName I get the following error:

System.ApplicationException: 'Cannot guess driver for F:\Temp\2\tmp7A67.tmp'

This is in the generation of the geoTiffOutputFileName file.

Does anyone know why I am getting this error?

Thanks
Ian

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20240324/721b86ac/attachment.htm>


More information about the gdal-dev mailing list