Changeset 3559 for DPPP


Ignore:
Timestamp:
07/03/08 10:03:38 (11 years ago)
Author:
mkochan
Message:

Changed interaction with WMS script.

Location:
DPPP/kml/csml2kml
Files:
1 deleted
2 edited

Legend:

Unmodified
Added
Removed
  • DPPP/kml/csml2kml/python/csml2kml/csml2kml/tests/testWMSCapabilities.py

    r3555 r3559  
    11import getopt 
    22from cElementTree import ElementTree, XML 
    3  
    43import utils 
    54from WMSCapabilities import * 
     5import sys 
    66 
     7# Get the config file name 
     8if len(sys.argv) != 2: 
     9    raise ValueError('The name of config file (and nothing more) required') 
     10configFileName = sys.argv[1] 
     11 
     12# Load the config file (in XML format) 
    713configElementTree = ElementTree() 
    8 configElementTree.parse('../../../../testdata/obs.conf.xml') 
     14configElementTree.parse(configFileName) 
     15 
     16# Read the output root directory, and the root network URL where the output will be stored 
     17outputRootDirectory = configElementTree.getroot().find('OutputRootDirectory').text 
     18serverRootDirectory = configElementTree.getroot().find('ServerRootDirectory').text 
     19 
     20# Read in the Layers document from the source WMS service 
    921wmsRequestConfigElement = configElementTree.getroot().find('WMSRequest') 
    10  
    1122wmsCapabilitiesUrl = wmsRequestConfigElement.find('URL').text + '?request=GetCapabilities' 
    1223wmsCapabilitiesElement = XML( utils.wget(wmsCapabilitiesUrl) ) 
     
    1425wmsCapabilities.parseXML(wmsCapabilitiesElement) 
    1526 
     27# Initialise the convertor and perform the conversion 
    1628wmsLayersConvertor = WMSLayersConvertor( 
    17     wmsCapabilities.topWmsLayer, wmsRequestConfigElement, '../../../../output/wms-obs2', 'http://bond.badc.rl.ac.uk:8089' 
     29    wmsCapabilities.topWmsLayer, wmsRequestConfigElement, outputRootDirectory, serverRootDirectory 
    1830    ) 
    1931wmsLayersConvertor.convert() 
  • DPPP/kml/csml2kml/testdata/obs.conf.xml

    r3516 r3559  
    88    <CRS>EPSG:4326</CRS> 
    99  </WMSRequest> 
     10  <OutputRootDirectory>/home/users/mkochan/svn-root/kml/csml2kml/output/wms-obs2</OutputRootDirectory> 
     11  <ServerRootDirectory>http://bond.badc.rl.ac.uk:8089</ServerRootDirectory> 
    1012</WMSLayers2KML> 
Note: See TracChangeset for help on using the changeset viewer.