| 150 | im.save('threadtest_wfs_%s.png' % (name)) |
| 151 | |
| 152 | def draw_map_wms(name, save=0): |
| 153 | #print "making map in thread %s" % (name) |
| 154 | mo = mapscript.mapObj(TESTMAPFILE) |
| 155 | |
| 156 | # WFS layer |
| 157 | lo = mapscript.layerObj() |
| 158 | lo.name = 'jpl_wms' |
| 159 | lo.setProjection('+init=epsg:4326') |
| 160 | lo.connectiontype = mapscript.MS_WMS |
| 161 | # lo.connection = 'http://wms.jpl.nasa.gov/wms.cgi?' |
| 162 | lo.connection = 'http://labs.metacarta.com/wms/vmap0?' |
| 163 | lo.metadata.set('wms_service', 'WMS') |
| 164 | lo.metadata.set('wms_server_version', '1.1.1') |
| 165 | lo.metadata.set('wms_name', 'basic') |
| 166 | lo.metadata.set('wms_style', 'visual') |
| 167 | lo.metadata.set('wms_format', 'image/jpeg') |
| 168 | lo.type = mapscript.MS_LAYER_RASTER |
| 169 | lo.status = mapscript.MS_DEFAULT |
| 170 | lo.debug = mapscript.MS_ON |
| 171 | mo.insertLayer(lo) |
| 172 | |
| 173 | if not mo.web.imagepath: |
| 174 | mo.web.imagepath = os.environ.get('TEMP', None) or INCOMING |
| 175 | mo.debug = mapscript.MS_ON |
| 176 | mo.selectOutputFormat('image/jpeg') |
| 177 | im = mo.draw() |
| 178 | if save: |
| 179 | im.save('threadtest_wms_%s.jpg' % (name)) |
| 180 | |
| 181 | class OWSRequestTestCase(unittest.TestCase): |
| 182 | |