scripts/utils/kml_add_index.py
def write_kmz(dom, outkmz, arcname='doc.kml'):
    """write pretty xml to doc.kml then zip to kmz"""
    kml_temp = os.path.join(os.path.dirname(outkmz), arcname)
    with open(outkmz, "w") as f:
        f.write(dom.toprettyxml())

    # with zipfile.ZipFile(outkmz, "w") as f:
    #     f.write(kml_temp, arcname, zipfile.ZIP_STORED)
    #
    # os.remove(kml_temp)
write pretty xml to doc.kml then zip to kmz
write pretty xml to doc.kml then zip to kmz
write pretty xml to doc . kml then zip to kmz
def write_kmz(dom, outkmz, arcname='doc.kml'):
    kml_temp = os.path.join(os.path.dirname(outkmz), arcname)
    with open(outkmz, "w") as f:
        f.write(dom.toprettyxml())
     os.remove(kml_temp)
def write_kmz ( dom , outkmz , arcname = 'doc.kml' ) : kml_temp = os . path . join ( os . path . dirname ( outkmz ) , arcname ) with open ( outkmz , "w" ) as f : f . write ( dom . toprettyxml ( ) )
write pretty xml to doc.kml then zip to kmz
write pretty xml to doc . kml then zip to kmz
"""write pretty xml to doc.kml then zip to kmz""" # with zipfile.ZipFile(outkmz, "w") as f: #     f.write(kml_temp, arcname, zipfile.ZIP_STORED) # # os.remove(kml_temp)
dom
outkmz
arcname