I'm working on a map layout engine using Python and ReportLab and have come across a problem and was wondering if anyone can give me some insight.
Scenerio:
I'm trying to generate an image using OWSLib (see example code). The layer that I'm trying to render has an opacity of 40%. When I generate the image using the sample code the background is transparent but the features are not but if I generate the image using shp2img -m /www/cgi-bin/mapfiles/40e6b3a8.map -o test.png the features are 40% opaque. Any ideas how I can make this work using OWSLib or if I'm doing something wrong? Thank you for any help.
OWSLIB EXAMPLE CODE
from owslib.wms import WebMapService
wms = WebMapService('http://localhost/cgi-bin/mapserv?MAP=/www/cgi-bin/mapfiles/40e6b3a8.map&', version='1.1.1')
img = wms.getmap( layers=['vlyr_oqiJw4Ib4U'],
srs='EPSG:26910',
bbox=(685400,5616300,689500,5619500),
size=(800, 600),
format='image/png',
transparent=True
)
print(img.geturl())
out = open('c:/temp/test2.png', 'wb')
out.write(img.read())
out.close()