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

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

Changed convertor so that KML files now contain full KML folder hierarchy.

Line 
1from cElementTree import ElementTree, XML
2
3import utils
4from WMSCapabilities import *
5
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) )
18wmsCapabilities = WMSCapabilities()
19wmsCapabilities.parseXML(wmsCapabilitiesElement)
20###print wmsCapabilities
21###print
22
23wmsLayersConvertor = WMSLayersConvertor(
24    wmsCapabilities.topWmsLayer, wmsRequestConfigElement, '../../../../output/wms-obs2', 100
25    )
26wmsLayersConvertor.convert()
Note: See TracBrowser for help on using the repository browser.