source: cows/trunk/cows/test/owslibdoctests/wms_mainoperations.txt @ 4858

Subversion URL: http://proj.badc.rl.ac.uk/svn/ndg/cows/trunk/cows/test/owslibdoctests/wms_mainoperations.txt@4858
Revision 4858, 1.9 KB checked in by domlowe, 12 years ago (diff)

wms doctest working

Line 
1COWS Web Map Service doctest
2============================
3
4WMS Version 1.1.1
5=================
6
7
8    >>> from owslib.wms import WebMapService
9    >>> wms=WebMapService('http://localhost:5000/famous_control_month/csml_WMS', version='1.1.1')
10    >>> wms.url
11    'http://localhost:5000/famous_control_month/csml_WMS'
12    >>> wms.version
13    '1.1.1'
14    >>> wms.identification.type
15    'OGC:WMS'
16    >>> wms.identification.version
17    '1.1.1'
18    >>> wms.identification.title
19    'CSML test server'
20    >>> wms.identification.abstract
21    >>> wms.identification.keywords
22    []
23    >>> wms.provider.name
24    'British Atmospheric Data Centre'
25    >>> wms.provider.url
26    'http://localhost:5000/famous_control_month/csml_WMS?'
27    >>> wms.provider.contact.email
28    'D.Lowe@rl.ac.uk'
29    >>> wms.provider.contact.name
30    'Dominic Lowe'
31    >>> wms.provider.contact.organization
32    'British Atmospheric Data Centre'
33    >>> wms.provider.contact.address
34    '\n\t    STFC Rutherford Appleton Laboratory\n\t  '
35    >>> wms.provider.contact.city
36    'Didcot'
37    >>> wms.provider.contact.region
38    'Oxfordshire'
39    >>> wms.provider.contact.postcode
40    'OX11 0QX'
41    >>> wms.provider.contact.country
42    'UK'
43    >>> for item in wms.items(): print item[0]; break
44    toa_incoming_shortwave_flux
45    >>> layer=wms['surface_temperature']
46    >>> layer.title
47    'surface_temperature'
48    >>> layer.keywords
49    []
50    >>> layer.boundingBox
51    (-180.0, -90.0, 180.0, 90.0, 'EPSG:4326')
52    >>> layer.timepositions[0]
53    '2792-12-16T00:00:00.0'
54    >>> wms.getOperationByName('GetMap').formatOptions
55    ['image/gif', 'image/png', 'image/jpg', 'image/tiff']
56    >>> output=wms.getmap(layers=['surface_temperature'],time='2992-11-16T00:00:00.0',bbox=(-150,-80,150,80), srs='EPSG:4326', format='image/png',size=(300, 250)) 
57    >>> f=open('testimage.png', 'wb')
58    >>> f.write(output.read())
59    >>> f.close()
60
61
62
63
Note: See TracBrowser for help on using the repository browser.