<div dir="ltr">Hi,<div><br></div><div>I have been having troubles finding a working WMS server for OWSLib but I finally found a URL that is working with my code:</div><div><br></div><div><a href="http://raster.nationalmap.gov/arcgis/services/Orthoimagery/USGS_EROS_Ortho_NAIP/ImageServer/WMSServer?request=GetCapabilities&service=WMS">http://raster.nationalmap.gov/arcgis/services/Orthoimagery/USGS_EROS_Ortho_NAIP/ImageServer/WMSServer?request=GetCapabilities&service=WMS</a><br></div><div><br></div><div>I'd like to have a world map at this high resolution since this is just a U.S. map, if anybody knows of any, but in any case the problem I am facing now is that when I attempt to call a large size, I get the following error:</div><div><br></div><div><b>KeyError: 'content-type'</b></div><div><br></div><div>The error does not show up if I stay below or close to 3MB so I am unsure if this is a limit that the WMS server is imposing on me or if it is an error in the Python code. I read somewhere there is a default limit to act as the safeguard to the user so they don't accidentally download more than they can handle but am unsure. I will post my 'working' script below. You will only need to run it to see the error and downsize the size for it to actually download the request.</div><div><br></div><div>Thanks for your time<br>Noah</div><div><br>###################################################################</div><div><br></div><div><div>from owslib.wms import WebMapService</div><div>wms = WebMapService('<a href="http://raster.nationalmap.gov/arcgis/services/Orthoimagery/USGS_EROS_Ortho_NAIP/ImageServer/WMSServer?request=GetCapabilities&service=WMS">http://raster.nationalmap.gov/arcgis/services/Orthoimagery/USGS_EROS_Ortho_NAIP/ImageServer/WMSServer?request=GetCapabilities&service=WMS</a>')</div><div><br></div><div><br></div><div>print(wms.identification.type)</div><div>print(wms.identification.title)</div><div>print(list(wms.contents))</div><div>print(wms['0'].title)</div><div>print(wms['0'].boundingBox)</div><div>print(wms['0'].crsOptions)</div><div>print(wms['0'].styles)</div><div><br></div><div>print(wms.getOperationByName('GetMap').formatOptions)</div><div><br></div><div>print(list(wms.contents))</div><div><br></div><div><br></div><div>img = wms.getmap(   layers=['0'],</div><div>                     styles=[],</div><div>                     srs='EPSG:4326',</div><div>                     bbox=(-111.85738494873, 39.9462890625, -110.98876849262, 40.445555601989),</div><div>                     size=(8000, 4598),</div><div>                     format='image/jpeg',</div><div>                     transparent=True,</div><div>                     stream = True)</div><div>out = open('nationalmap.jpg', 'wb')</div><div>out.write(img.read())</div><div>out.close()</div></div></div>