Dear all,<div><br></div><div>wms getmap produces image file but size is 1kb and could not show anything. Could you help me please?</div><div><br></div><div><div>>>> wms = WebMapService('<a href="http://labs.metacarta.com/wms/vmap0">http://labs.metacarta.com/wms/vmap0</a>', version='1.1.1')</div>
<div>>>> list(wms.contents)</div><div>['disp', 'bridge', 'priroad', 'stateboundary', 'country_02', 'country_01', 'secr</div><div>oad', 'CAUSE', 'statelabel', 'Vmap0', 'depthcontour', 'ctylabel', 'population',</div>
<div>'clabel', 'basic', 'rail', 'coastline_02', 'coastline_01', 'trail', 'ground_01',</div><div> 'inwater', 'ground_02', 'tunnel', 'ocean', 'ferry', 'river']</div>
<div>>>> wms['basic'].boundingBoxWGS84</div><div>(-180.0, -90.0, 180.0, 90.0)</div><div>>>> wms['basic'].crsOptions</div><div>['EPSG:900913', 'EPSG:4326', 'EPSG:4269']</div>
<div>>>> wms['basic'].styles</div><div>{}</div><div>>>> [<a href="http://op.name">op.name</a> for op in wms.operations]</div><div>['GetCapabilities', 'GetMap', 'GetFeatureInfo', 'DescribeLayer', 'GetLegendGraph</div>
<div>ic', 'GetStyles']</div><div>>>> wms.getOperationByName('GetMap').methods</div><div>{'Post': {'url': '<a href="http://vmap0.tiles.osgeo.org/wms?'">http://vmap0.tiles.osgeo.org/wms?'</a>}, 'Get': {'url': '<a href="http://vm">http://vm</a></div>
<div><a href="http://ap0.tiles.osgeo.org/wms?'">ap0.tiles.osgeo.org/wms?'</a>}}</div><div>>>> wms.getOperationByName('GetMap').formatOptions</div><div>['image/jpeg', 'image/png', 'image/gif', 'image/png; mode=24bit', 'image/wbmp',</div>
<div>'image/tiff', 'image/svg+xml']</div><div>>>></div><div>>>> img = wms.getmap(layers=['basic'], srs='EPSG:4326', bbox=(-180.0, -90.0, 180.0, 90.0), size=(256, 256), format='image/png')</div>
<div>>>> out = open('a.png', 'wb')</div><div>>>> out.write(img.read())</div><div>>>> out.close()</div><div>>>> dir(img)</div><div>['__doc__', '__init__', '__iter__', '__module__', '__repr__', 'close', 'code', '</div>
<div>fileno', 'fp', 'getcode', 'geturl', 'headers', 'info', 'msg', 'next', 'read', 'readline', 'readlines', 'url']</div><div>>>> img.geturl()</div>
<div>'<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">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></div>
<div>ent=FALSE'</div><div>>>></div></div>