scripts/utils/kml_add_index.py
def add_timespan(infile, suffix='_timespan'):
    """Read a KMZ file and add a timespan based on the placemark name"""
    # read input kml/kmz data
    # parse raw kml as document object model
    rawkml = read_kmz(infile)
    dom = xml.dom.minidom.parseString(rawkml)

    # add begin timespan to each placemark element
    for i, elem in enumerate(dom.getElementsByTagName('Placemark')):
        # begin = elem.getElementsByTagName("name")[0].childNodes[0].data
        elem.appendChild(create_index(dom, i))

    # write output kmz file
    write_kmz(dom, infile[:-4] + suffix + '.kml')
Read a KMZ file and add a timespan based on the placemark name
Read a KMZ file and add a timespan based on the placemark name
Read a KMZ file and add a timespan based on the placemark name
def add_timespan(infile, suffix='_timespan'):
    rawkml = read_kmz(infile)
    dom = xml.dom.minidom.parseString(rawkml)
    for i, elem in enumerate(dom.getElementsByTagName('Placemark')):
        elem.appendChild(create_index(dom, i))
    write_kmz(dom, infile[:-4] + suffix + '.kml')
def add_timespan ( infile , suffix = '_timespan' ) : rawkml = read_kmz ( infile ) dom = xml . dom . minidom . parseString ( rawkml ) for i , elem in enumerate ( dom . getElementsByTagName ( 'Placemark' ) ) : elem . appendChild ( create_index ( dom , i ) ) write_kmz ( dom , infile [ : - 4 ] + suffix + '.kml' )
Read a KMZ file and add a timespan based on the placemark name
Read a KMZ file and add a timespan based on the placemark name
"""Read a KMZ file and add a timespan based on the placemark name""" # read input kml/kmz data # parse raw kml as document object model # add begin timespan to each placemark element # begin = elem.getElementsByTagName("name")[0].childNodes[0].data # write output kmz file
infile
suffix