Changeset 3187 for DPPP


Ignore:
Timestamp:
09/01/08 09:00:47 (12 years ago)
Author:
mkochan
Message:

Prototype: Changed dataset folders in KML to be closed & unloaded by default. Added multiple datasets to extraction.

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

Legend:

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

    r3185 r3187  
    8888    #and append the folder to the kml document. 
    8989    kml_document.append(kml_folder) 
    90  
    91     break 
    9290     
    9391#Now attach the Document element as a subelement of the root 'kml' element 
     
    104102f.close() 
    105103print 'Written to %s'%outputfile 
    106  
    107  
  • DPPP/kml/csml2kml/python/kmlfeatures.py

    r3185 r3187  
    2929        year = (int(sYear) - 1900) / 10  # get decade ("logical" year) 
    3030        month = int(sMonth) 
    31         daysInMonth = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31] 
    32         isLeapYear = (year % 4) == 0  # even logical years can be leap years :) 
    33         if isLeapYear: 
    34             daysInMonth[1] = 29 
     31        #daysInMonth = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31] 
     32        #isLeapYear = (year % 4) == 0  # even logical years can be leap years :) 
     33        #if isLeapYear: 
     34        #    daysInMonth[1] = 29 
    3535        startDate = "%04d-%02d-%02d" % (year, month, 1) 
    36         endDate = "%04d-%02d-%02d" % (year, month, daysInMonth[month-1]) 
    37          
     36        if month+1 <= 12: 
     37            endDate = "%04d-%02d-%02d" % (year, month+1, 1) 
     38        else: 
     39            endDate = "%04d-%02d-%02d" % (year+1, 1, 1) 
     40       
    3841        return (startDate, endDate) 
    3942     
     
    5457        SubElement(folder, 'name').text=str(self.description) 
    5558        SubElement(folder, 'open').text='0' 
     59        SubElement(folder, 'visibility').text='0' 
    5660         
    5761        tempcount=0 
     
    6468            SubElement(go, 'name').text=self.shortname + ' ' + timestep 
    6569            SubElement(go, 'open').text='0' 
     70            SubElement(go, 'visibility').text='0' 
    6671            timespan=SubElement(go, 'TimeSpan') 
    6772            #TODO - need a method for retrieving time bounds 
Note: See TracChangeset for help on using the changeset viewer.