scripts/utils/kml_add_index.py
def read_kmz(infile):
    """read raw kml/kmz file"""
    if infile.upper().endswith('.KML'):
        with open(infile, "r") as f:
            return f.read()

    if infile.upper().endswith('.KMZ'):
        with zipfile.ZipFile(infile, "r") as f:
            return f.read(f.namelist()[0])
read raw kml/kmz file
read raw kml/kmz file
read raw kml / kmz file
def read_kmz(infile):
    if infile.upper().endswith('.KML'):
        with open(infile, "r") as f:
            return f.read()
    if infile.upper().endswith('.KMZ'):
        with zipfile.ZipFile(infile, "r") as f:
            return f.read(f.namelist()[0])
def read_kmz ( infile ) : if infile . upper ( ) . endswith ( '.KML' ) : with open ( infile , "r" ) as f : return f . read ( ) if infile . upper ( ) . endswith ( '.KMZ' ) : with zipfile . ZipFile ( infile , "r" ) as f : return f . read ( f . namelist ( ) [ 0 ] )
read raw kml/kmz file
read raw kml / kmz file
"""read raw kml/kmz file"""
infile