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

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

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

Line 
1
2OWSLib
3======
4Package for working with OGC web map and feature services.
5
6OWSLib provides a common API for accessing service metadata and wrappers for
7GetCapabilities, GetMap, and GetFeature requests.
8
9
10Dependencies
11------------
12
13Before installing, see DEPENDENCIES.txt.
14
15
16Installation
17------------
18
19$ python setup.py install
20
21
22Usage
23-----
24
25Find out what a WMS has to offer. Service metadata:
26
27    >>> from owslib.wms import WebMapService
28    >>> wms = WebMapService('http://wms.jpl.nasa.gov/wms.cgi', version='1.1.1')
29    >>> wms.capabilities.service
30    'OGC:WMS'
31    >>> wms.capabilities.title
32    'JPL Global Imagery Service'
33
34Available layers:
35
36    >>> [layer.name for layer in wms.capabilities.contents]
37    ['global_mosaic', 'global_mosaic_base', 'us_landsat_wgs84', 'srtm_mag', 'daily_terra_721', 'daily_aqua_721', 'daily_terra_ndvi', 'daily_aqua_ndvi', 'daily_terra', 'daily_aqua', 'BMNG', 'modis', 'huemapped_srtm', 'srtmplus', 'worldwind_dem', 'us_ned', 'us_elevation', 'us_colordem']
38
39Details of a layer:
40
41    >>> wms.capabilities.getContentByName('global_mosaic').title
42    'WMS Global Mosaic, pan sharpened'
43    >>> wms.capabilities.getContentByName('global_mosaic').boundingBox
44    >>> wms.capabilities.getContentByName('global_mosaic').boundingBoxWGS84
45    (-180.0, -60.0, 180.0, 84.0)
46    >>> wms.capabilities.getContentByName('global_mosaic').crsOptions
47    ['EPSG:4326', 'AUTO:42003']
48    >>> wms.capabilities.getContentByName('global_mosaic').styles
49    {'pseudo_bright': {'title': 'Pseudo-color image (Uses IR and Visual bands, 542 mapping), gamma 1.5'}, 'pseudo': {'title': '(default) Pseudo-color image, pan sharpened (Uses IR and Visual bands, 542 mapping), gamma 1.5'}, 'visual': {'title': 'Real-color image, pan sharpened (Uses the visual bands, 321 mapping), gamma 1.5'}, 'pseudo_low': {'title': 'Pseudo-color image, pan sharpened (Uses IR and Visual bands, 542 mapping)'}, 'visual_low': {'title': 'Real-color image, pan sharpened (Uses the visual bands, 321 mapping)'}, 'visual_bright': {'title': 'Real-color image (Uses the visual bands, 321 mapping), gamma 1.5'}}
50
51Available methods, their URLs, and available formats:
52
53    >>> [op.name for op in wms.capabilities.operations]
54    ['GetCapabilities', 'GetMap']
55    >>> wms.capabilities.getOperationByName('GetMap').methods
56    {'Get': {'url': 'http://wms.jpl.nasa.gov/wms.cgi?'}}
57    >>> wms.capabilities.getOperationByName('GetMap').formatOptions
58    ['image/jpeg', 'image/png', 'image/geotiff', 'image/tiff']
59
60That's everything needed to make a request for imagery:
61
62    >>> img = wms.getmap(   layers=['global_mosaic'],
63    ...                     styles=['visual_bright'],
64    ...                     srs='EPSG:4326',
65    ...                     bbox=(-112, 36, -106, 41),
66    ...                     size=(300, 250),
67    ...                     format='image/jpeg',
68    ...                     transparent=True
69    ...                     )
70    >>> out = open('jpl_mosaic_visb.jpg', 'wb')
71    >>> out.write(img.read())
72    >>> out.close()
73
74A very similar API exists for WebFeatureService. See
75tests/MapServerWFSCapabilities.txt for details.
76
77
78Known Issues
79------------
80
81OWSLib works with WMS version 1.1.1 and WFS 1.0.0 Other versions are not
82supported at this time.
83
84
85Support
86-------
87
88OWSLib shares a wiki and email list with the Python Cartographic Library:
89
90http://lists.gispython.org/mailman/listinfo/community
91http://trac.gispython.org/projects/PCL/wiki
92
93Updated project information can be found at
94
95http://trac.gispython.org/projects/PCL/wiki/OwsLib
96
97
Note: See TracBrowser for help on using the repository browser.