source: DPPP/kml/csml2kml/python/csml2kml/csml2kml/scripts/stations2kml.py @ 3582

Subversion URL: http://proj.badc.rl.ac.uk/svn/ndg/DPPP/kml/csml2kml/python/csml2kml/csml2kml/scripts/stations2kml.py@3582
Revision 3582, 490 bytes checked in by mkochan, 12 years ago (diff)

Created the script stations2kml.py runnable from command line.

Line 
1import sys
2from csml2kml.StationConvertor import StationConvertor
3from cElementTree import ElementTree
4
5# Get the config file name
6if len(sys.argv) != 2:
7    raise ValueError('The name of config file (and nothing more) required')
8configFileName = sys.argv[1]
9
10# Load the configuration XML element
11configTree = ElementTree()
12configTree.parse(configFileName)
13configRoot = configTree.getroot()
14config = configRoot.find('NPStations2KML')
15
16# Do the conversion
17StationConvertor(config).convert()
Note: See TracBrowser for help on using the repository browser.