def discovery_dile_by_position(lon,lat): """Discovery the diles given a lon/lat position. :example: /discovery/dile/by/position/-135.0/22.5 :param: dim -- json document :param: var -- single or multiple string variables' names :returns: geojson -- the return a feature collection with the selected diles. ------------------------------------------------------------------------------------------- """ 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.queryIntersectPoint(app.config['LOCATION'], float(lon), float(lat)) qbm.addField(query) qbm.addProjection({"_id": 0, "uri" : 1}) return jsonify(query_diles_db(qbm.getQuery()))