source: TI02-CSML/trunk/services/3rdParty/OWSLib-0.2.0/tests/JPLMap.txt @ 2194

Subversion URL: http://proj.badc.rl.ac.uk/svn/ndg/TI02-CSML/trunk/services/3rdParty/OWSLib-0.2.0/tests/JPLMap.txt@2194
Revision 2194, 858 bytes checked in by lawrence, 13 years ago (diff)

Adding various specs and 3rd party code of interest for the CSML
services development.

Line 
1
2Imports
3
4    >>> from owslib.wms import WebMapService
5   
6Connect to WMS
7
8    >>> wms = WebMapService('http://wms.jpl.nasa.gov/wms.cgi', version='1.1.1')
9   
10Get map image
11
12    >>> img = wms.getmap(layers=['global_mosaic'], srs='EPSG:4326', bbox=(-112,36,-106,41), format='image/jpeg', size=(300,250), transparent=True, bgcolor='#000000', method='Get')
13    >>> img.info().gettype()
14    'image/jpeg'
15   
16    >>> data = img.read()
17    >>> out = open('jplmap.jpg', 'wb')
18    >>> out.write(data)
19    >>> out.close()
20   
21Expect an exception in the case of a bad request
22
23    >>> img = wms.getmap(layers=['totally bogus'], srs='EPSG:4326', bbox=(-112,36,-106,41), format='image/jpeg', size=(300,250), transparent=True, bgcolor='#000000', method='Get')
24    Traceback (most recent call last):
25    ...
26    ServiceException: The layer "totally bogus" is unknown.
27
Note: See TracBrowser for help on using the repository browser.