Ignore:
Timestamp:
11/03/08 14:45:00 (14 years ago)
Author:
mkochan
Message:

Created the script stations2kml.py runnable from command line.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • DPPP/kml/csml2kml/python/csml2kml/csml2kml/StationConvertor.py

    r3576 r3582  
    1616    ''' 
    1717     
    18     def __init__(self, config, kmlFilename): 
     18    def __init__(self, config): 
    1919        '''Initialize the convertor and set it up according to the config file.''' 
    2020         
    2121        self.config = config 
    22         self.kmlFilename = kmlFilename 
    2322 
    24         # Read config document name 
    25         self.documentName = self.config.find('name').text 
     23        # Read the KMZ file name 
     24        self.kmlFilename = self.config.find('OutputKmzFilename').text 
     25 
     26        # Read the document name 
     27        self.documentName = self.config.find('DocumentName').text 
    2628 
    2729        # URL of GeoServer to get a <wfs:StationCollection> from 
    28         self.geoServerUrl = self.config.find('GeoServerRequest/URL').text 
     30        self.geoServerRequestUrl = self.config.find('GetAllStationsRequestURL').text 
    2931 
    3032        # Get template for placemark balloons; create a KML style for placemarks 
    31         self.balloonTemplate = self.config.find('GeoServerRequest/BalloonTemplate').text 
     33        self.balloonTemplate = self.config.find('BalloonTemplate').text 
    3234        self.placemarkKmlStyle = createDefaultPlacemarKMLStyle(balloonTemplate = self.balloonTemplate) 
    3335 
    3436        # Initialize placemark data -- i.e. values to be substituted for placeholders in the balloon template 
    3537        self.stationData = {} 
    36         data = self.config.findall('GeoServerRequest/StationData/Datum') 
     38        data = self.config.findall('StationData/Datum') 
    3739        for datum in data: 
    3840            datumName = datum.get('name') 
     
    118120 
    119121        # Get a collection of stations from a GeoServer, and put the stations into a list 
    120         geoServerResponse = wget(self.geoServerUrl) 
     122        geoServerResponse = wget(self.geoServerRequestUrl) 
    121123        wfsStationsCollection = WFSStationCollection() 
    122124        wfsStationsCollection.parseString(geoServerResponse) 
Note: See TracChangeset for help on using the changeset viewer.