Create a new ROI dataset

Description: Create a new ROI dataset
URI: /datasets/ROI
http method: POST

@app.route('/datasets/ROI', methods=['POST'])
def creat_roi_dataset():

    if not request.json:
        return ('',400)

    name = request.json['name']
    cur = conn.cursor()
    query = "CREATE TABLE roi."+name+" (rid bigserial , density bigint, score double precision, range box)"


    try:
        cur.execute(query)
    except psycopg2.Error as e:
        conn.rollback()
        cur.close()
        return('',400)

    conn.commit()
    cur.close()
    return ('',200)

results matching ""

    No results matching ""