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

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

tests now point at famous test subset, formatting capabilities template

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/wms', version='1.1.1')
10    >>> wms.url
11    'http://localhost:5000/famous/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/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]
44    None
45    sea_ice_thickness
46    air_temperature
47    sea_water_salinity
48    cloud_area_fraction
49    >>> layer=wms['sea_water_salinity']
50    >>> layer.title
51    'sea_water_salinity'
52    >>> layer.keywords
53    []
54    >>> layer.boundingBox
55    (-180.0, -90.0, 180.0, 90.0, 'EPSG:4326')
56    >>> layer.timepositions[0]
57    '2793-06-01T00:00:00.0'
58    >>> wms.getOperationByName('GetMap').formatOptions
59    ['image/gif', 'image/png', 'image/jpg', 'image/tiff']
60    >>> output=wms.getmap(layers=['sea_water_salinity'],time='2982-11-16T00:00:00.0',bbox=(-150,-80,150,80), srs='EPSG:4326', format='image/png',size=(300, 250)) 
61    >>> f=open('testimage.png', 'wb')
62    >>> f.write(output.read())
63    >>> f.close()
64
65
66
67
Note: See TracBrowser for help on using the repository browser.