Hi,

I'm updating a wms extension for Thuban using OWSLib 0.3.

I have the following problem. The image read from the WMS server is
considered as broken by the wxWindow frontend. The "workaround" I found
is saving the stream to a file and then open it in "rb" mode ... :

-----------------------------------------------------------------------------------------
wms_response = self.wmsserver.getmap(layers=self.wms_layers,
styles=None, 
                                     srs="EPSG:%s" % epsg_id,
bbox=bbox, 
                                     size=(width, height),
format=self.wmsformat,
                                     transparent=True)
out = open('wms_image.png', 'wb')
out.write(wms_response.read())
out.close()
return open('wms_image.png', "rb").read(), self.format
-----------------------------------------------------------------------------------------

The stream is then read by a cStringIO.StringIO object and passed to a
wx.ImageFromStream object ...

Returning wms_response.read() does not work and gives an WX error
message saying the file is corrupted. 

Is this a known problem ? 

Didrik




_______________________________________________
Community mailing list
[email protected]
http://lists.gispython.org/mailman/listinfo/community

Reply via email to