Overpass API regression suite coverage (Saxony) / overpass_api/statements/make_area.h

overpass_api/statements/make_area.h

1 of 3 instrumented lines run by the suite (33.3%) 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 modify
6 * it under the terms of the GNU Affero General Public License as
7 * published by the Free Software Foundation, either version 3 of the
8 * 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 of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU Affero General Public License
16 * along with Overpass_API. If not, see <http://www.gnu.org/licenses/>.
17 */
19#ifndef DE__OSM3S___OVERPASS_API__STATEMENTS__MAKE_AREA_H
20#define DE__OSM3S___OVERPASS_API__STATEMENTS__MAKE_AREA_H
22#include <map>
23#include <string>
24#include <vector>
25#include "statement.h"
28// Tries to make an area from the ways in the "from"-std::set.
29// It assumes that
30// - all nodes referenced in the ways exist also in the nodes
31// - the ways do intersect each other only at nodes that are members of all involved ways
32// - the ways can be concatenated such that they form only closed ways.
33// It produces the datastructure Area described in script_datatypes.h
34// - due to the size restrictions, the algorithm might split up line segments and produce
35// addtional vertices. It does not add nodes for these datastructures to the "into"-std::set,
36// they are contained only in the Area dataset.
37class Make_Area_Statement : public Output_Statement
39 public:
40 Make_Area_Statement(int line_number_, const std::map< std::string, std::string >& attributes,
41 Parsed_Query& global_settings);
420 virtual std::string get_name() const { return "make-area"; }
43 virtual void execute(Resource_Manager& rman);
440 virtual ~Make_Area_Statement() {}
45 static Generic_Statement_Maker< Make_Area_Statement > statement_maker;
47673673 q static bool is_used() { return is_used_; }
49 private:
50 std::string input, pivot;
51 bool return_area;
53 static std::pair< uint32, Uint64 > detect_pivot(const Set& pivot);
54 static Node::Id_Type check_node_parity(const Set& pivot);
55 static std::pair< Node::Id_Type, Way::Id_Type > create_area_blocks
56 (std::map< Uint31_Index, std::vector< Area_Block > >& areas, bool& wraps_around_date_line,
57 uint32 id, const Set& pivot);
58 static uint32 shifted_lat(uint32 ll_index, uint64 coord);
59 static int32 lon_(uint32 ll_index, uint64 coord);
60 static void add_segment_blocks
61 (std::map< Uint31_Index, std::vector< Area_Block > >& areas, uint32 id);
63 static bool is_used_;
64};
66#endif