Changeset 3537


Ignore:
Timestamp:
27/02/08 15:59:44 (11 years ago)
Author:
mkochan
Message:

Changed WMSLayer convertor to save to KMZ files.

Location:
DPPP/kml/csml2kml/python/csml2kml/csml2kml
Files:
2 edited

Legend:

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

    r3534 r3537  
    386386 
    387387            # Save the KML document 
    388             filename = parentDir + '/' + wmsLayer.title + '.kml' 
    389             kmlDocument.save(filename) 
    390             print 'Saved file "%s"' % filename 
     388            dockmlFilename = parentDir + '/doc.kml' 
     389            kmzFilename = parentDir + '/' + wmsLayer.title + '.kmz' 
     390            kmlDocument.save(dockmlFilename) 
     391            quietZipCommand = 'zip -q ' + ' "' + kmzFilename + '" "' + dockmlFilename + '"' 
     392            os.system(quietZipCommand) 
     393            os.remove(dockmlFilename) 
     394            print 'Saved file "%s"' % kmzFilename 
    391395 
    392396        def _convertToDirectory(wmsLayer, parentLayersStack, parentDir, currentLevel): 
  • DPPP/kml/csml2kml/python/csml2kml/csml2kml/tests/testWMSCapabilities.py

    r3531 r3537  
    55 
    66configElementTree = ElementTree() 
    7 configElementTree.parse('../../../../testdata/obs.conf.xml') 
     7configElementTree.parse('../../../../testdata/ar4.conf.xml') 
    88wmsRequestConfigElement = configElementTree.getroot().find('WMSRequest') 
    99 
     
    1818wmsCapabilities = WMSCapabilities() 
    1919wmsCapabilities.parseXML(wmsCapabilitiesElement) 
    20 ###print wmsCapabilities 
    21 ###print 
    2220 
    2321wmsLayersConvertor = WMSLayersConvertor( 
    24     wmsCapabilities.topWmsLayer, wmsRequestConfigElement, '../../../../output/wms-obs2', 100 
     22    wmsCapabilities.topWmsLayer, wmsRequestConfigElement, '../../../../output/wms-ar4', 2 
    2523    ) 
    2624wmsLayersConvertor.convert() 
Note: See TracChangeset for help on using the changeset viewer.