def osm(): min_lon = float(request.args.get("minLon")) max_lon = float(request.args.get("maxLon")) min_lat = float(request.args.get("minLat")) max_lat = float(request.args.get("maxLat")) if min_lon > max_lon: raise BadRequest("Min longitude is larger than max longitude.") if min_lat > max_lat: raise BadRequest("Min latitude is larger than max latitude.") query = overpass.ql_query( (min_lat, min_lon, max_lat, max_lon), tag="building" ) response = overpass.request(query) feature_collection = overpass.as_geojson(response, 'polygon') return jsonify(feature_collection)
def get_geojson(bounds): query = overpass.ql_query(bounds, tag='building') response = overpass.request(query) return (response)
def test_ql_query_novalue(): query = ql_query(_BOUNDS, _TAG, case_insensitive=False) assert query == _EXPECTED_4
def test_ql_query_multiple_nocase(): query = ql_query(_BOUNDS, _TAG, _VALUES_MULTIPLE, case_insensitive=True) assert query == _EXPECTED_3
def test_ql_query_unique(): query = ql_query(_BOUNDS, _TAG, _VALUES_UNIQUE, case_insensitive=False) assert query == _EXPECTED_1