I am trying to export a raster image from a WMS using gdal_translate and have not had any success. I have read http://www.gdal.org/frmt_wms.html but still no success. In my XML file, what should the values for SizeX and SizeY represent?

Here is the command line parameters: gdal_translate -of JPEG -outsize 500 250 ac3.xml ac3.jpg.

Error Message: Input file size is 2666666, 1333333 0ERROR 1: GDALWMS: The server returned unknown exception. ERROR 1: ac3.xml, band 1: IReadBlock failed at X offset 0, Y offset 0

Here is my ac3.xml:

<Service name="WMS">

1 Answer 1


You must look at the GetCapabilities of that server. The layer name is not "AlleghenyCountyImagery2010" but it is "0". Edit that into your XML file and your gdal_translate command will work.

SizeX and SizeY comes from extents and native resolution of the WMS service. If the site is 100 km wide and resolution is 1 m/pixel then SizeX is 100000.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.