def ground_overlays(self):
        ground_overlays = []

        archive = ZipFile(self.get_filename('kmz'))

        on=False
        with archive.open('doc.kml') as kml:
            kml = StringIO(kml.read().replace('xsi:', "").replace('xmlns="', 'xmlnamespace="'))
            for event, elt in etree.iterparse(kml,events=['start','end'], remove_comments=True, remove_blank_text=True):
                print event, elt.tag
                if event == 'start':
                    if elt.tag == 'GroundOverlay':
                        ground_overlays.append({})
                        on = True
                    elif on and elt.tag in {'name', 'href'}:
                        ground_overlays[-1][elt.tag] = elt.text
                    elif on and elt.tag in {'west', 'east', 'north', 'south', 'rotation'}:
                        ground_overlays[-1][elt.tag] = float(elt.text)
                on = on and not (event == 'end' and elt.tag == 'GroundOverlay')

        # openlayers needs image dimensions right now.  should fix this in OL.
        for i, ol in enumerate(ground_overlays):
            ground_overlays[i]['width'], ground_overlays[i]['height'] = Image.open(StringIO(self.open_stream(ol['href']).read())).size


        return ground_overlays
dataset/ETHPy150Open hydroshare/hydroshare2/ga_resources/drivers/kmz.py/KmzDriver.ground_overlays/original