source: DPPP/kml/csml2kml/python/csml2kml/csml2kml/tests/testWMSCapabilities.py @ 3516

Subversion URL: http://proj.badc.rl.ac.uk/svn/ndg/DPPP/kml/csml2kml/python/csml2kml/csml2kml/tests/testWMSCapabilities.py@3516
Revision 3516, 887 bytes checked in by mkochan, 14 years ago (diff)

Changed WMSCapabilities.py so that it generates "obs" dataset. Still need to change ViewWholeTimecourse?.

RevLine 
[3516]1from cElementTree import ElementTree, XML
[3479]2
3import utils
4from WMSCapabilities import *
5
[3516]6configElementTree = ElementTree()
7configElementTree.parse('../../../../testdata/obs.conf.xml')
8wmsRequestConfigElement = configElementTree.getroot().find('WMSRequest')
9
10###etree = ElementTree()
11###etree.parse('../../../../testdata/ar4-shortened.xml')
12###wmsCapabilities = WMSCapabilities()
13###wmsCapabilitiesElement = etree.getroot()
14###print wmsCapabilities
15
16wmsCapabilitiesUrl = wmsRequestConfigElement.find('URL').text + '?request=GetCapabilities'
17wmsCapabilitiesElement = XML( utils.wget(wmsCapabilitiesUrl) )
[3479]18wmsCapabilities = WMSCapabilities()
19wmsCapabilities.parseXML(wmsCapabilitiesElement)
[3506]20###print wmsCapabilities
21###print
[3497]22
[3514]23wmsLayersConvertor = WMSLayersConvertor(
[3516]24    wmsCapabilities.topWmsLayer, wmsRequestConfigElement, '../../../../output/wms-obs', 0
[3514]25    )
[3506]26wmsLayersConvertor.convert()
Note: See TracBrowser for help on using the repository browser.