Ignore:
Timestamp:
05/03/08 16:26:22 (13 years ago)
Author:
mkochan
Message:

Corrected bug in saving KML files, working on saving KMZ files.

File:
1 edited

Legend:

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

    r3549 r3555  
    4646    def toKML(self, wmsRequestConfigElement, viewTypes, parentDir, parentDirUrl): 
    4747 
    48         title_ = self.title.replace(' ', '_')  # self.title underscored 
     48        title_ = self.title.replace(' ', '_').replace('/', '_').replace('\\', '_')  # self.title underscored 
     49 
    4950        dir = parentDir + '/' + title_ 
    5051        dirUrl = parentDirUrl + '/' + title_ 
    51         filename = dir + '.kml' 
    52         fileUrl = dirUrl + '.kml' 
    53  
    54         # create directory currentDir 
     52        filename = dir + '.kmz' 
     53        fileUrl = dirUrl + '.kmz' 
     54 
     55        # create directory dir 
    5556        os.mkdir(dir) 
     57        print 'Created directory "%s".' % dir 
    5658 
    5759        kmlDocument = KMLDocument(self.title, []) 
     
    6163                ) 
    6264        kmlDocument.save(filename) 
    63      
    64         return KMLNetworkLink(self.title, fileUrl) 
     65        print 'Saved file "%s".' % filename 
     66     
     67        return KMLNetworkLink(self.title, fileUrl, visible = False) 
    6568 
    6669class BottomWMSLayer(WMSLayer): 
Note: See TracChangeset for help on using the changeset viewer.