Changeset 3716 for DPPP


Ignore:
Timestamp:
01/04/08 16:36:51 (11 years ago)
Author:
mkochan
Message:

Moved csml2kml API code into a dir named "API"

Location:
DPPP/kml/csml2kml/python
Files:
3 added
4 edited
9 moved

Legend:

Unmodified
Added
Removed
  • DPPP/kml/csml2kml/python/csml2kml/csml2kml/scripts/stations2kml.py

    r3657 r3716  
    33from csml2kml.ET import ElementTree 
    44 
    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] 
     5def main(): 
    96 
    10 # Load the configuration XML element 
    11 config = ElementTree().parse(configFileName) 
     7    # Get the config file name 
     8    if len(sys.argv) != 2: 
     9        raise ValueError('The name of config file (and nothing more) required') 
     10    configFileName = sys.argv[1] 
    1211 
    13 # Do the conversion 
    14 StationConvertor(config).convert() 
     12    # Load the configuration XML element 
     13    config = ElementTree().parse(configFileName) 
     14 
     15    # Do the conversion 
     16    StationConvertor(config).convert() 
     17 
     18if __name__ == '__main__': 
     19    main() 
  • DPPP/kml/csml2kml/python/csml2kml/csml2kml/scripts/wms2kml.py

    r3657 r3716  
    55from csml2kml.WMSLayerConvertor import WMSLayerConvertor 
    66 
    7 # Get the config file name 
    8 if len(sys.argv) != 2: 
    9     raise ValueError('The name of config file (and nothing more) required') 
    10 configFileName = sys.argv[1] 
     7def main(): 
    118 
    12 # Load the config file (in XML format) 
    13 configElementTree = ElementTree() 
    14 configElementTree.parse(configFileName) 
     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] 
    1513 
    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 
     14    # Load the config file (in XML format) 
     15    configElementTree = ElementTree() 
     16    configElementTree.parse(configFileName) 
    1917 
    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) 
     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 
    2621 
    27 # Initialise the convertor and perform the conversion 
    28 wmsLayerConvertor = WMSLayerConvertor( 
    29     wmsCapabilities.topWmsLayer, wmsRequestConfigElement, outputRootDirectory, serverRootDirectory 
    30     ) 
    31 wmsLayerConvertor.convert() 
     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() 
     34 
     35if __name__ == '__main__': 
     36    main() 
  • DPPP/kml/csml2kml/python/csml2kml/setup.py

    r3684 r3716  
     1''' 
     2csml2kml, a Python package for conversion of CSML and associated context data into KML document, viawable in Google Earth. 
     3Copyright (C) 2008 BADC (British Atmospheric Data Centre) 
     4 
     5@author: Martin Kochan, Tessella Support Services 
     6''' 
     7 
    18from setuptools import setup, find_packages 
    29 
    310setup(name='csml2kml', 
    411      version='1.0b2', 
    5       install_depends=['csml>=2.0b'], 
     12      dependency_links=['http://ndg.nerc.ac.uk/dist'], 
     13      install_requires=['csml'], 
    614      include_package_data=True, 
    715      packages=find_packages(), 
    8       author='Martin Kochan, for the British Atmospheric Data Centre, UK', 
    9       description='Package eventually intended for converting CSML documents into KML documents, viawable in Google Earth.' 
     16      author='Martin Kochan', 
     17      description='Performs conversion of CSML and associated context data into KML document, viawable in Google Earth.', 
     18      entry_points = { 
     19        'console_scripts': [ 
     20            'wms2kml = scripts.wms2kml:main', 
     21            'station2kml = scripts.station2kml:main' 
     22            ] 
     23        } 
    1024      ) 
  • DPPP/kml/csml2kml/python/csml2kmlpylon/csml2kmlpylon.egg-info/SOURCES.txt

    r3657 r3716  
    66test.ini 
    77csml2kmlpylon/__init__.py 
    8 csml2kmlpylon/__init__.pyc 
    98csml2kmlpylon/websetup.py 
    109csml2kmlpylon.egg-info/PKG-INFO 
     
    1716csml2kmlpylon.egg-info/top_level.txt 
    1817csml2kmlpylon/config/__init__.py 
    19 csml2kmlpylon/config/__init__.pyc 
    2018csml2kmlpylon/config/environment.py 
    21 csml2kmlpylon/config/environment.pyc 
    22 csml2kmlpylon/config/midas.csml2kmlpylon.conf.xml 
    2319csml2kmlpylon/config/middleware.py 
    24 csml2kmlpylon/config/middleware.pyc 
    2520csml2kmlpylon/config/routing.py 
    26 csml2kmlpylon/config/routing.pyc 
    2721csml2kmlpylon/controllers/__init__.py 
    28 csml2kmlpylon/controllers/__init__.pyc 
    2922csml2kmlpylon/controllers/csmlGrapher.py 
    30 csml2kmlpylon/controllers/csmlGrapher.pyc 
    3123csml2kmlpylon/controllers/error.py 
    3224csml2kmlpylon/controllers/template.py 
    3325csml2kmlpylon/lib/__init__.py 
    34 csml2kmlpylon/lib/__init__.pyc 
    3526csml2kmlpylon/lib/app_globals.py 
    36 csml2kmlpylon/lib/app_globals.pyc 
    3727csml2kmlpylon/lib/base.py 
    3828csml2kmlpylon/lib/helpers.py 
    39 csml2kmlpylon/lib/helpers.pyc 
    4029csml2kmlpylon/model/__init__.py 
    4130csml2kmlpylon/public/index.html 
     31csml2kmlpylon/public/midas_stations.kmz 
    4232csml2kmlpylon/tests/__init__.py 
    4333csml2kmlpylon/tests/test_models.py 
    4434csml2kmlpylon/tests/functional/__init__.py 
    45 docs/index.txt 
Note: See TracChangeset for help on using the changeset viewer.