def define_bounds(bounds):
    """
    Extracts bounds from region drawn/defined
	Args:
		`bounds`= json bounds captured
    Returns:
        `bbox`= bounds of the region defined (list)
		`bbox2`= bounds of the region defined (string)
    """
    
    #ew_poly=GeoJSON(data=dc.last_draw)
    new_poly=str(bounds)

    if("'geometry': None" in new_poly):
        raise NameError('Error: No rectangle selected')
    new_poly=new_poly.rsplit("'coordinates': ", 1)[1]
    new_poly=new_poly.replace('[[[','').replace('[','').replace(']]]}})','').replace('],','').replace(',','').split(" ")
    longs=new_poly[0::2]
    lats=new_poly[1::2]
    minlong=float(min(longs))
    maxlong=float(max(longs))
    minlat=float(max(lats)) #ignores sign
    maxlat=float(min(lats)) #ignores sign
    bbox2 = str(minlong)+","+str(minlat)+","+str(maxlong)+","+str(maxlat)
    bbox =(minlong,minlat,maxlong,maxlat)
    bounds2=(minlong,maxlong,minlat,maxlat)
    #bbox =[minlong,minlat,maxlong,maxlat]
    #print(bbox2)
    print("Bounds:", bbox)
    return bbox, bbox2, bounds2