Skip to main content
deleted 4 characters in body
Source Link
user2856
  • 69.6k
  • 6
  • 119
  • 203

You need tocan instantiate an output driver (e.g PNG/JPEG) and use that driver to create a copy of the wms on file.

I don't code in C#, but the following python snippet should help, the methods will be the same/similar.

ds=gdal.Open("<GDAL_WMS>etc...</GDAL_WMS>", gdal.GA_ReadOnly)

outfile='C:/Temp/test.png'
pngdrv=gdal.GetDriverByName('PNG')
pngdrv.CreateCopy(outfile,ds)

You need to instantiate an output driver (e.g PNG/JPEG) and use that driver to create a copy of the wms on file.

I don't code in C#, but the following python snippet should help, the methods will be the same/similar.

ds=gdal.Open("<GDAL_WMS>etc...</GDAL_WMS>", gdal.GA_ReadOnly)

outfile='C:/Temp/test.png'
pngdrv=gdal.GetDriverByName('PNG')
pngdrv.CreateCopy(outfile,ds)

You can instantiate an output driver (e.g PNG/JPEG) and use that driver to create a copy of the wms on file.

I don't code in C#, but the following python snippet should help, the methods will be the same/similar.

ds=gdal.Open("<GDAL_WMS>etc...</GDAL_WMS>", gdal.GA_ReadOnly)

outfile='C:/Temp/test.png'
pngdrv=gdal.GetDriverByName('PNG')
pngdrv.CreateCopy(outfile,ds)
Source Link
user2856
  • 69.6k
  • 6
  • 119
  • 203

You need to instantiate an output driver (e.g PNG/JPEG) and use that driver to create a copy of the wms on file.

I don't code in C#, but the following python snippet should help, the methods will be the same/similar.

ds=gdal.Open("<GDAL_WMS>etc...</GDAL_WMS>", gdal.GA_ReadOnly)

outfile='C:/Temp/test.png'
pngdrv=gdal.GetDriverByName('PNG')
pngdrv.CreateCopy(outfile,ds)