Skip to content

Commit 0df1b08

Browse files
committed
nwr for query implemented but not yet tested.
1 parent c188566 commit 0df1b08

File tree

5 files changed

+181
-91
lines changed

5 files changed

+181
-91
lines changed

src/overpass_api/frontend/map_ql_parser.cc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1303,7 +1303,8 @@ TStatement* parse_statement(typename TStatement::Factory& stmt_factory, Parsed_Q
13031303
type = *token;
13041304
if (type == "rel")
13051305
type = "relation";
1306-
else if (type != "node" && type != "way" && type != "relation" && type != "area")
1306+
else if (type != "node" && type != "way" && type != "relation" && type != "nwr"
1307+
&& type != "derived" && type != "area")
13071308
{
13081309
if (error_output)
13091310
error_output->add_parse_error("Unknown type \"" + type + "\"", token.line_col().first);

src/overpass_api/statements/item.cc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -100,17 +100,17 @@ bool Item_Constraint::collect(Resource_Manager& rman, Set& into,
100100
const Set* input = rman.get_set(item->get_input_name());
101101
if (input)
102102
{
103-
if (type == QUERY_WAY)
103+
if (type & QUERY_WAY)
104104
{
105105
collect_elements(input->ways, into.ways, ids, invert_ids);
106106
collect_elements(input->attic_ways, into.attic_ways, ids, invert_ids);
107107
}
108-
else if (type == QUERY_RELATION)
108+
if (type & QUERY_RELATION)
109109
{
110110
collect_elements(input->relations, into.relations, ids, invert_ids);
111111
collect_elements(input->attic_relations, into.attic_relations, ids, invert_ids);
112112
}
113-
else if (type == QUERY_AREA)
113+
if (type & QUERY_AREA)
114114
collect_elements(input->areas, into.areas, ids, invert_ids);
115115
}
116116
else

src/overpass_api/statements/pivot.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ bool Pivot_Constraint::get_data
203203
{
204204
const Set* input_set = rman.get_set(stmt->get_input());
205205

206-
if (type == QUERY_WAY)
206+
if (type & QUERY_WAY)
207207
{
208208
std::vector< Way::Id_Type > pivot_ids;
209209
if (input_set)
@@ -223,7 +223,7 @@ bool Pivot_Constraint::get_data
223223
intersect_ids.begin()), intersect_ids.end());
224224
collect_elems(rman, *osm_base_settings().WAYS, intersect_ids, into.ways);
225225
}
226-
else if (type == QUERY_RELATION)
226+
if (type & QUERY_RELATION)
227227
{
228228
std::vector< Relation::Id_Type > pivot_ids;
229229
if (input_set)

0 commit comments

Comments
 (0)