thanks alot for quick answer. You are right, I have the same error<div><br></div><div>I finally find a correct wms server and run with these parameters. An image file is produced showing USA srtm</div><div><br></div><div><div>
>>> wms = WebMapService('<a href="http://wms.lizardtech.com/lizardtech/iserv/ows?service=WMS&request=GETCAPABILITIES">http://wms.lizardtech.com/lizardtech/iserv/ows?service=WMS&request=GETCAPABILITIES</a>', version='1.1.1')</div>
<div>>>> img = wms.getmap(layers=["usa_srtm"], srs="EPSG:4326", bbox=(-126.0, 16.999722, -63.999722, 50.0), size=(1366,768), format="image/jpeg", transparent=True)</div><div>>>> out = open('d:\sample.jpg', 'wb')</div>
<div>>>> out.write(img.read())</div><div>>>> out.close()</div><div>>>> img.geturl()</div><div>'<a href="http://wms.lizardtech.com/lizardtech/iserv/ows?layers=usa_srtm&styles=&srs=EPSG%3A4326&format=image%2Fjpeg&request=GetMap&bgcolor=0xFFFFFF&height=768&width=1366&version=1.1.1&bbox=-126.0%2C16.999722%2C-63.999722%2C50.0&exceptions=application%2Fvnd.ogc.se_xml&transparent=TRUE">http://wms.lizardtech.com/lizardtech/iserv/ows?layers=usa_srtm&styles=&srs=EPSG%3A4326&format=image%2Fjpeg&request=GetMap&bgcolor=0xFFFFFF&height=768&width=1366&version=1.1.1&bbox=-126.0%2C16.999722%2C-63.999722%2C50.0&exceptions=application%2Fvnd.ogc.se_xml&transparent=TRUE</a>'</div>
<div>>>> </div><div><br></div><div>regards,</div><div>Volkan K.</div><br><div class="gmail_quote">2012/2/22 Dominic Lowe <span dir="ltr"><<a href="mailto:dominic.lowe@stfc.ac.uk">dominic.lowe@stfc.ac.uk</a>></span><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi,<br>
<br>
If you open a.png in a text editor you can see that the server has<br>
reported an error:<br>
     msLoadMap(): Unable to access file. (/osgeo/tiles/vmap0/.map)<br>
<br>
So it looks like it may be a setup problem with the server.<br>
<br>
Cheers,<br>
Dom<br>
<div class="im"><br>
On 22/02/12 07:19, <a href="mailto:osmankepoglu@gmail.com">osmankepoglu@gmail.com</a> wrote:<br>
> Dear all,<br>
><br>
> wms getmap produces image file but size is 1kb and could not show anything. Could you help me please?<br>
><br>
>>>> wms = WebMapService('<a href="http://labs.metacarta.com/wms/vmap0" target="_blank">http://labs.metacarta.com/wms/vmap0</a>', version='1.1.1')<br>
>>>> list(wms.contents)<br>
> ['disp', 'bridge', 'priroad', 'stateboundary', 'country_02', 'country_01', 'secr<br>
> oad', 'CAUSE', 'statelabel', 'Vmap0', 'depthcontour', 'ctylabel', 'population',<br>
> 'clabel', 'basic', 'rail', 'coastline_02', 'coastline_01', 'trail', 'ground_01',<br>
>   'inwater', 'ground_02', 'tunnel', 'ocean', 'ferry', 'river']<br>
>>>> wms['basic'].boundingBoxWGS84<br>
> (-180.0, -90.0, 180.0, 90.0)<br>
>>>> wms['basic'].crsOptions<br>
> ['EPSG:900913', 'EPSG:4326', 'EPSG:4269']<br>
>>>> wms['basic'].styles<br>
> {}<br>
</div>>>>> [<a href="http://op.name" target="_blank">op.name</a><<a href="http://op.name" target="_blank">http://op.name</a>>  for op in wms.operations]<br>
<div class="im">> ['GetCapabilities', 'GetMap', 'GetFeatureInfo', 'DescribeLayer', 'GetLegendGraph<br>
> ic', 'GetStyles']<br>
>>>> wms.getOperationByName('GetMap').methods<br>
> {'Post': {'url': '<a href="http://vmap0.tiles.osgeo.org/wms?'" target="_blank">http://vmap0.tiles.osgeo.org/wms?'</a>}, 'Get': {'url': '<a href="http://vm" target="_blank">http://vm</a><br>

</div>> <a href="http://ap0.tiles.osgeo.org/wms?" target="_blank">ap0.tiles.osgeo.org/wms?</a>'<<a href="http://ap0.tiles.osgeo.org/wms?" target="_blank">http://ap0.tiles.osgeo.org/wms?</a>'>}}<br>
<div class="HOEnZb"><div class="h5">>>>> wms.getOperationByName('GetMap').formatOptions<br>
> ['image/jpeg', 'image/png', 'image/gif', 'image/png; mode=24bit', 'image/wbmp',<br>
> 'image/tiff', 'image/svg+xml']<br>
>>>> img = wms.getmap(layers=['basic'], srs='EPSG:4326', bbox=(-180.0, -90.0, 180.0, 90.0), size=(256, 256), format='image/png')<br>
>>>> out = open('a.png', 'wb')<br>
>>>> out.write(img.read())<br>
>>>> out.close()<br>
>>>> dir(img)<br>
> ['__doc__', '__init__', '__iter__', '__module__', '__repr__', 'close', 'code', '<br>
> fileno', 'fp', 'getcode', 'geturl', 'headers', 'info', 'msg', 'next', 'read', 'readline', 'readlines', 'url']<br>
>>>> img.geturl()<br>
> '<a href="http://vmap0.tiles.osgeo.org/wms?layers=basic&styles=&srs=EPSG%3A4326&format=image%2Fpng&request=GetMap&bgcolor=0xFFFFFF&height=256&width=256&version=1.1.1&bbox=-180.0%2C-90.0%2C180.0%2C90.0&exceptions=application%2Fvnd.ogc.se_xml&transpar" target="_blank">http://vmap0.tiles.osgeo.org/wms?layers=basic&styles=&srs=EPSG%3A4326&format=image%2Fpng&request=GetMap&bgcolor=0xFFFFFF&height=256&width=256&version=1.1.1&bbox=-180.0%2C-90.0%2C180.0%2C90.0&exceptions=application%2Fvnd.ogc.se_xml&transpar</a><br>

> ent=FALSE'<br>
<br>
</div></div><span class="HOEnZb"><font color="#888888">--<br>
Scanned by iCritical.<br>
<br>
------------------------------------------------------------------------------<br>
Virtualization & Cloud Management Using Capacity Planning<br>
Cloud computing makes use of virtualization - but cloud computing<br>
also focuses on allowing computing to be delivered as a service.<br>
<a href="http://www.accelacomm.com/jaw/sfnl/114/51521223/" target="_blank">http://www.accelacomm.com/jaw/sfnl/114/51521223/</a><br>
_______________________________________________<br>
owslib-devel mailing list<br>
<a href="mailto:owslib-devel@lists.sourceforge.net">owslib-devel@lists.sourceforge.net</a><br>
<a href="https://lists.sourceforge.net/lists/listinfo/owslib-devel" target="_blank">https://lists.sourceforge.net/lists/listinfo/owslib-devel</a><br>
</font></span></blockquote></div><br></div>