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

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

Created a scripts directory and the script "wms2kml.py".

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