''

def __init__(self, layer, dbinfo, queries, clip=True, srid=900913, simplify=1.0, simplify_until=16, padding=0):

    self.layer = layer
    keys = ('host', 'user', 'password', 'database', 'port', 'dbname')
    self.dbinfo = dict([(k, v) for (k, v) in dbinfo.items() if (k in keys)])
    self.clip = bool(clip)
    self.srid = int(srid)
    self.simplify = float(simplify)
    self.simplify_until = int(simplify_until)
    self.padding = int(padding)
    self.columns = {}
    if isinstance(queries, dict):
        n_zooms = (max((int(z) for z in queries)) + 1)
        queryiter = ((int(z), q) for (z, q) in queries.iteritems())
    else:
        n_zooms = len(queries)
        queryiter = enumerate(queries)
    self.queries = ([None] * n_zooms)
    for (z, query) in queryiter:
        if (query is None):
            continue
        url = urljoin(layer.config.dirpath, query)
        (scheme, h, path, p, q, f) = urlparse(url)
        if ((scheme in ('file', '')) and exists(path)):
            query = open(path).read()
        elif ((scheme == 'http') and ('    ' not in url)):
            query = urlopen(url).read()
        self.queries[z] = query
