Overpass API regression suite coverage (Saxony) / overpass_api/statements/bbox_query.cc
overpass_api/statements/bbox_query.cc
80 of 136 instrumented lines run by the suite (58.8%) at 8edf11b0419c (this file on GitHub).
runnever runcolumns: line, executions, queries (click for the queries that run the line)
1/** Copyright 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018 Roland Olbricht et al.2 *3 * This file is part of Overpass_API.4 *5 * Overpass_API is free software: you can redistribute it and/or modify6 * it under the terms of the GNU Affero General Public License as7 * published by the Free Software Foundation, either version 3 of the8 * License, or (at your option) any later version.9 *10 * Overpass_API is distributed in the hope that it will be useful,11 * but WITHOUT ANY WARRANTY; without even the implied warranty of12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the13 * GNU General Public License for more details.14 *15 * You should have received a copy of the GNU Affero General Public License16 * along with Overpass_API. If not, see <http://www.gnu.org/licenses/>.17 */19#include <algorithm>20#include <sstream>22#include "../../template_db/block_backend.h"23#include "../../template_db/random_file.h"24#include "../core/settings.h"25#include "../data/collect_members.h"26#include "../data/bbox_filter.h"27#include "../data/way_geometry_store.h"28#include "bbox_query.h"29#include "recurse.h"32//-----------------------------------------------------------------------------35class Bbox_Constraint : public Query_Constraint36{37 public:38 Query_Filter_Strategy delivers_data(Resource_Manager& rman);41598216 q filter_(Bbox_Double(bbox->get_south(), bbox->get_west(), bbox->get_north(), bbox->get_east())) {}42 bool get_ranges(Resource_Manager& rman, Ranges< Uint32_Index >& ranges);43 bool get_ranges(Resource_Manager& rman, Ranges< Uint31_Index >& ranges);45 void filter(Resource_Manager& rman, Set& into);46 void filter(const Statement& query, Resource_Manager& rman, Set& into);49 private:50 Bbox_Query_Statement* bbox;51 Bbox_Filter filter_;52};55Query_Filter_Strategy Bbox_Constraint::delivers_data(Resource_Manager& rman)62301196 q return ((bbox_.north - bbox_.south) * std::abs(bbox_.east - bbox_.west) < 1.0) ? prefer_ranges : ids_useful;66bool Bbox_Constraint::get_ranges(Resource_Manager& rman, Ranges< Uint32_Index >& ranges)73bool Bbox_Constraint::get_ranges74 (Resource_Manager& rman, Ranges< Uint31_Index >& ranges)81void Bbox_Constraint::filter(Resource_Manager& rman, Set& into)87void Bbox_Constraint::filter(const Statement& query, Resource_Manager& rman, Set& into)92//-----------------------------------------------------------------------------95Bbox_Query_Statement::Statement_Maker Bbox_Query_Statement::statement_maker;96Bbox_Query_Statement::Criterion_Maker Bbox_Query_Statement::criterion_maker;99Statement* Bbox_Query_Statement::Criterion_Maker::create_criterion(const Token_Node_Ptr& input_tree,100 const std::string& result_type, const std::string& into,101 Statement::Factory& stmt_factory, Parsed_Query& global_settings, Error_Output* error_output)142Bbox_Query_Statement::Bbox_Query_Statement143 (int line_number_, const std::map< std::string, std::string >& input_attributes, Parsed_Query& global_settings)199Bbox_Query_Statement::Bbox_Query_Statement(const Bbox_Double& bbox)2004222 q : Output_Statement(0), south(bbox.south), north(bbox.north), west(bbox.west), east(bbox.east) {}203Bbox_Query_Statement::~Bbox_Query_Statement()211const Ranges< Uint32_Index >& Bbox_Query_Statement::get_ranges_32()219const Ranges< Uint31_Index >& Bbox_Query_Statement::get_ranges_31()227void Bbox_Query_Statement::execute(Resource_Manager& rman)244Query_Constraint* Bbox_Query_Statement::get_query_constraint()