Ignore:
Timestamp:
15/01/08 11:40:07 (13 years ago)
Author:
mkochan
Message:
 
File:
1 edited

Legend:

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

    r3214 r3219  
    4545 
    4646        # Create and populate a separate folder for each view 
    47         for view in self.config.getRoot().findall('View'): 
    48             splitByText = view.find('SplitBy').text 
    49             logicalYearTransformText = view.find('LogicalYearTransform').text 
    50             print 'Split by %s, using %s' % (splitByText, logicalYearTransformText) 
     47        for viewConfig in self.config.getRoot().findall('View'): 
     48            kmlViewElement = Element('Folder') 
     49            SubElement(kmlViewElement, 'name').text=view.get('name') 
     50            SubElement(kmlViewElement, 'open').text='1' 
    5151             
    5252            # Create a separate KML folder for each feature 
     53            features = self.ds.featureCollection.featureMembers 
    5354            for feature in features: 
    5455                 
    5556                # GridSeriesFeatureWrapper allows extended querying of a GridSeriesFeature object 
    56                 gsFeature=GridSeriesFeatureWrapper(feature)  
    57  
    58                 description = feature.description.CONTENT      
     57                gsFeature=GridSeriesFeatureWrapper(feature) 
     58                description = feature.description.CONTENT    
    5959                name = feature.name.CONTENT 
    6060                bBox = gsFeature.getBBox() 
     
    6767                    ) 
    6868 
    69                 # Call the outputKML method of this object to generate a populated KML Folder element 
    70                 kmlViewElement = gsKML.outputKML(view) 
    71  
    72                 # Append the folder to the kml document. 
    73                 kmlDocumentElement.append(kmlViewElement) 
     69                # Generate a populated KML folder containing the feature, append it to the view 
     70                kmlFeatureElement = gsKML.exportFeature(viewConfig) 
     71                kmlViewElement.append(kmlFeatureElement) 
     72             
     73            kmlDocumentElement.append(kmlViewElement) 
    7474             
    7575        # Attach the Document element as a subelement of the root 'kml' element 
Note: See TracChangeset for help on using the changeset viewer.