'Render a single tile, return a ConfirmationResponse instance.'

def renderTile(self, width, height, srs, coord):

    if (coord.zoom < 12):
        raise KnownUnknown(('MirrorOSM    provider    only    handles    data    at    zoom    12    or    higher,    not    %d.' % coord.zoom))
    start = time()
    garbage = []
    (handle, filename) = mkstemp(prefix='mirrorosm-', suffix='.tablename')
    tmp_prefix = ('mirrorosm_' + b16encode(basename(filename)[10:(-10)]).lower())
    garbage.append(filename)
    close(handle)
    (handle, filename) = mkstemp(prefix='mirrorosm-', suffix='.osm.gz')
    garbage.append(filename)
    close(handle)
    try:
        length = download_api_data(filename, coord, self.api_base, self.layer.projection)
        prepare_data(filename, tmp_prefix, self.dbkwargs, self.osm2pgsql, self.layer.projection)
        db = _connect(**self.dbkwargs).cursor()
        ul = self.layer.projection.coordinateProj(coord)
        lr = self.layer.projection.coordinateProj(coord.down().right())
        create_tables(db, self.prefix, tmp_prefix)
        populate_tables(db, self.prefix, tmp_prefix, (ul.x, ul.y, lr.x, lr.y))
        clean_up_tables(db, tmp_prefix)
        db.close()
        message = ('Retrieved    %dK    of    OpenStreetMap    data    for    tile    %d/%d/%d    in    %.2fsec    from    %s    (%s).\n' % (length, coord.zoom, coord.column, coord.row, (time() - start), self.api_base, datetime.now()))
        return ConfirmationResponse(coord, message, True)
    except Exception as e:
        message = ('Error    in    tile    %d/%d/%d:    %s' % (coord.zoom, coord.column, coord.row, e))
        raise NoTileLeftBehind(ConfirmationResponse(coord, message, False))
    finally:
        for filename in garbage:
            unlink(filename)
