Changeset 3742
- Timestamp:
- 03/04/08 14:23:33 (13 years ago)
- Location:
- DPPP/kml/python/csml2kml
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
DPPP/kml/python/csml2kml/csml2kml/__init__.py
r3717 r3742 9 9 import WMSLayer 10 10 import WMSLayerConvertor 11 import scripts -
DPPP/kml/python/csml2kml/csml2kml/scripts/stations2kml.py
r3717 r3742 3 3 from csml2kml.ET import ElementTree 4 4 5 # Get the config file name 6 if len(sys.argv) != 2: 7 raise ValueError('The name of config file (and nothing more) required') 8 configFileName = sys.argv[1] 9 10 # Load the configuration XML element 11 config = ElementTree().parse(configFileName) 12 13 # Do the conversion 14 StationConvertor(config).convert() 5 def main(): 6 # Get the config file name 7 if len(sys.argv) != 2: 8 raise ValueError('The name of config file (and nothing more) required') 9 configFileName = sys.argv[1] 10 11 # Load the configuration XML element 12 config = ElementTree().parse(configFileName) 13 14 # Do the conversion 15 StationConvertor(config).convert() -
DPPP/kml/python/csml2kml/csml2kml/scripts/wms2kml.py
r3717 r3742 5 5 from csml2kml.WMSLayerConvertor import WMSLayerConvertor 6 6 7 # Get the config file name8 if len(sys.argv) != 2:9 raise ValueError('The name of config file (and nothing more) required')10 configFileName = sys.argv[1]11 7 12 # Load the config file (in XML format) 13 configElementTree = ElementTree() 14 configElementTree.parse(configFileName) 15 16 # Read the output root directory, and the root network URL where the output will be stored 17 outputRootDirectory = configElementTree.getroot().find('OutputRootDirectory').text 18 serverRootDirectory = configElementTree.getroot().find('ServerRootDirectory').text 19 20 # Read in the Layers document from the source WMS service 21 wmsRequestConfigElement = configElementTree.getroot().find('WMSRequest') 22 wmsCapabilitiesUrl = wmsRequestConfigElement.find('URL').text + '?request=GetCapabilities' 23 wmsCapabilitiesElement = XML( wget(wmsCapabilitiesUrl) ) 24 wmsCapabilities = WMSCapabilities() 25 wmsCapabilities.parseXML(wmsCapabilitiesElement) 26 27 # Initialise the convertor and perform the conversion 28 wmsLayerConvertor = WMSLayerConvertor( 29 wmsCapabilities.topWmsLayer, wmsRequestConfigElement, outputRootDirectory, serverRootDirectory 30 ) 31 wmsLayerConvertor.convert() 8 def main(): 9 # Get the config file name 10 if len(sys.argv) != 2: 11 raise ValueError('The name of config file (and nothing more) required') 12 configFileName = sys.argv[1] 13 14 # Load the config file (in XML format) 15 configElementTree = ElementTree() 16 configElementTree.parse(configFileName) 17 18 # Read the output root directory, and the root network URL where the output will be stored 19 outputRootDirectory = configElementTree.getroot().find('OutputRootDirectory').text 20 serverRootDirectory = configElementTree.getroot().find('ServerRootDirectory').text 21 22 # Read in the Layers document from the source WMS service 23 wmsRequestConfigElement = configElementTree.getroot().find('WMSRequest') 24 wmsCapabilitiesUrl = wmsRequestConfigElement.find('URL').text + '?request=GetCapabilities' 25 wmsCapabilitiesElement = XML( wget(wmsCapabilitiesUrl) ) 26 wmsCapabilities = WMSCapabilities() 27 wmsCapabilities.parseXML(wmsCapabilitiesElement) 28 29 # Initialise the convertor and perform the conversion 30 wmsLayerConvertor = WMSLayerConvertor( 31 wmsCapabilities.topWmsLayer, wmsRequestConfigElement, outputRootDirectory, serverRootDirectory 32 ) 33 wmsLayerConvertor.convert() -
DPPP/kml/python/csml2kml/setup.py
r3739 r3742 8 8 author='Martin Kochan', 9 9 description='Package converting CSML documents and context documents into KML documents, viawable in Google Earth.', 10 entry_points = {'console_scripts': ['wms2kml = csml2kml.scripts.wms2kml ','stations2kml = csml2kml.scripts.stations2kml']}10 entry_points = {'console_scripts': ['wms2kml = csml2kml.scripts.wms2kml:main','stations2kml = csml2kml.scripts.stations2kml:main']} 11 11 )
Note: See TracChangeset
for help on using the changeset viewer.