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

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

Changed WMSLayer convertor to save to KMZ files.

Line 
1from cElementTree import ElementTree, XML
2
3import utils
4from WMSCapabilities import *
5
6configElementTree = ElementTree()
7configElementTree.parse('../../../../testdata/ar4.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
21wmsLayersConvertor = WMSLayersConvertor(
22    wmsCapabilities.topWmsLayer, wmsRequestConfigElement, '../../../../output/wms-ar4', 2
23    )
24wmsLayersConvertor.convert()
Note: See TracBrowser for help on using the repository browser.