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

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

    db = _connect(**self.dbkwargs).cursor()
    prepare_database(db, coord, self.layer.projection)
    counts = []
    db.execute('SELECT    n.id,    n.version,    EXTRACT(epoch    FROM    n.tstamp),\n                                                                                                                    u.id,    u.name,    n.changeset_id,\n                                                                                                                    ST_Y(n.geom),    ST_X(n.geom)\n                                                                                        FROM    nodes    n\n                                                                                        LEFT    OUTER    JOIN    users    u\n                                                                                                ON    n.user_id    =    u.id\n                                                                                        INNER    JOIN    box_node_list    b\n                                                                                                ON    b.id    =    n.id\n                                                                                        ORDER    BY    n.id')
    nodes = [Node(*row) for row in db.fetchall()]
    nodes_dict = dict([(node.id, node) for node in nodes])
    db.execute('SELECT    n.id,    t.k,    t.v\n                                                                                        FROM    node_tags    t\n                                                                                        INNER    JOIN    box_node_list    n\n                                                                                                ON    n.id    =    t.node_id\n                                                                                        ORDER    BY    n.id')
    for (node_id, key, value) in db.fetchall():
        nodes_dict[node_id].tag(key, value)
    db.execute('SELECT    w.id,    w.version,    EXTRACT(epoch    FROM    w.tstamp),\n                                                                                                                    u.id,    u.name,    w.changeset_id\n                                                                                        FROM    ways    w\n                                                                                        LEFT    OUTER    JOIN    users    u\n                                                                                                ON    w.user_id    =    u.id\n                                                                                        INNER    JOIN    box_way_list    b\n                                                                                                ON    b.id    =    w.id\n                                                                                        ORDER    BY    w.id')
    ways = [Way(*row) for row in db.fetchall()]
    ways_dict = dict([(way.id, way) for way in ways])
    db.execute('SELECT    w.id,    t.k,    t.v\n                                                                                        FROM    way_tags    t\n                                                                                        INNER    JOIN    box_way_list    w\n                                                                                                ON    w.id    =    t.way_id\n                                                                                        ORDER    BY    w.id')
    for (way_id, key, value) in db.fetchall():
        ways_dict[way_id].tag(key, value)
    db.execute('SELECT    w.id,    n.node_id,    n.sequence_id\n                                                                                        FROM    way_nodes    n\n                                                                                        INNER    JOIN    box_way_list    w\n                                                                                        ON    n.way_id    =    w.id\n                                                                                        ORDER    BY    w.id,    n.sequence_id')
    for (way_id, node_id, sequence_id) in db.fetchall():
        ways_dict[way_id].node(node_id)
    db.execute('SELECT    e.id,    e.version,    e.user_id,    u.name    AS    user_name,    e.tstamp,    e.changeset_id\n                                                                                        FROM    relations    e\n                                                                                        LEFT    OUTER    JOIN    users    u\n                                                                                        ON    e.user_id    =    u.id\n                                                                                        INNER    JOIN    box_relation_list    c\n                                                                                        ON    e.id    =    c.id\n                                                                                        ORDER    BY    e.id')
    counts.append(len(db.fetchall()))
    db.execute('SELECT    relation_id    AS    entity_id,    k,    v\n                                                                                        FROM    relation_tags    f\n                                                                                        INNER    JOIN    box_relation_list    c\n                                                                                        ON    f.relation_id    =    c.id\n                                                                                        ORDER    BY    entity_id')
    counts.append(len(db.fetchall()))
    db.execute('SELECT    relation_id    AS    entity_id,    member_id,    member_type,    member_role,    sequence_id\n                                                                                        FROM    relation_members    f\n                                                                                        INNER    JOIN    box_relation_list    c\n                                                                                        ON    f.relation_id    =    c.id\n                                                                                        ORDER    BY    entity_id,    sequence_id')
    counts.append(len(db.fetchall()))
    return SaveableResponse(nodes, ways)
    raise Exception(counts)
