

def _parse(self, elem):
    if (elem.tag != 'TileMap'):
        raise ValueError(('%s should be a TileMap' % (elem,)))
    self._element = elem
    self.version = elem.attrib.get('version')
    self.tilemapservice = elem.attrib.get('tilemapservice')
    self.title = testXMLValue(elem.find('Title'))
    self.abstract = testXMLValue(elem.find('Abstract'))
    self.srs = force900913(testXMLValue(elem.find('SRS')))
    bbox = elem.find('BoundingBox')
    self.boundingBox = (float(bbox.attrib['minx']), float(bbox.attrib['miny']), float(bbox.attrib['maxx']), float(bbox.attrib['maxy']))
    origin = elem.find('Origin')
    self.origin = (float(origin.attrib['x']), float(origin.attrib['y']))
    tf = elem.find('TileFormat')
    self.width = int(tf.attrib['width'])
    self.height = int(tf.attrib['height'])
    self.mimetype = tf.attrib['mime-type']
    self.extension = tf.attrib['extension']
    ts = elem.find('TileSets')
    if (ts is not None):
        self.profile = ts.attrib.get('profile')
        tilesets = ts.findall('TileSet')
        for tileset in tilesets:
            href = tileset.attrib['href']
            upp = float(tileset.attrib['units-per-pixel'])
            order = int(tileset.attrib['order'])
            self.tilesets.append({
                'href': href,
                'units-per-pixel': upp,
                'order': order,
            })

dataset/ETHPy150Open geopython/OWSLib/owslib/tms.py TileMap._parse/original