def discovery_dile_by_bbox(minLon,minLat,maxLon,maxLat): """Discovery the diles given a bounding box. :example: /discovery/dile/by/bbox/-135.0/22.5/-45.0/67.5 :param: dim -- json document :param: var -- single or multiple string variables' names :returns: geojson -- the return a feature collection with the selected diles. ------------------------------------------------------------------------------------------- """ bb = { "lat_min": float(minLat), "lat_max": float(maxLat), "lon_min": float(minLon), "lon_max": float(maxLon) } qbm = QueryBuilderMongo() d_param = request.args.get('dim') v_param = request.args.getlist('var') # creating the dimension query if d_param is not None: qbm = getDimentions(d_param, qbm) # creating the variables query if v_param: qbm = getVariables(v_param, qbm) query = qbm.queryIntersectBbox(app.config['LOCATION'],bb) qbm.addField(query) qbm.addProjection({"_id": 0, "uri" : 1}) return jsonify(query_diles_db(qbm.getQuery()))