Overpass API regression suite coverage (Saxony) / overpass_api/data/collect_members.cc

overpass_api/data/collect_members.cc

731 of 771 instrumented lines run by the suite (94.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 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#include "abstract_processing.h"
20#include "collect_members.h"
21#include "utils.h"
23#include <cstdint>
25//-----------------------------------------------------------------------------
27template< typename Container >
28void way_nd_ids_pos(
29 const Container& ways, const std::vector< int >& pos, std::vector< Node::Id_Type >& ids)
31118 q for (const auto& i : ways)
32115 q {
33115 q for (const auto& j : i.second)
34915 q {
35915 q auto it3 = pos.begin();
36965 q while (it3 != pos.end() && *it3 < 0)
3853 q if (*it3 + (int)j.nds.size() >= 0)
3953 q ids.push_back(j.nds[*it3 + j.nds.size()]);
4053 q ++it3;
42915 q while (it3 != pos.end() && *it3 == 0)
430 ++it3;
441785 q while(it3 != pos.end())
45873 q {
46873 q if (*it3 < (int)j.nds.size()+1)
47873 q ids.push_back(j.nds[*it3-1]);
48873 q ++it3;
49873 q }
50915 q }
51115 q }
55template< typename Container >
56void way_nd_ids_plain(const Container& ways, std::vector< Node::Id_Type >& ids)
572731892 q{
582731892 q for (const auto& i : ways)
593885454 q {
603885454 q for (const auto& j : i.second)
6121534753 q {
6221534753 q for (auto k : j.nds)
63192870653 q ids.push_back(k);
6421534753 q }
653885454 q }
662731892 q}
69template< typename Container >
70void way_nd_ids_once(const Container& ways, std::vector< Node::Id_Type >& ids)
723120 q for (const auto& i : ways)
73212713 q {
74212713 q for (const auto& j : i.second)
751150813 q {
761150813 q auto size = ids.size();
771150813 q for (auto k : j.nds)
785915513 q ids.push_back(k);
791150813 q std::sort(ids.begin()+size, ids.end());
801150813 q ids.erase(std::unique(ids.begin()+size, ids.end()), ids.end());
811150813 q }
82212713 q }
86template< typename Container >
87void way_nd_firstlast(const Container& ways, std::vector< Node::Id_Type >& ids)
892615 q for (const auto& i : ways)
901967 q {
911967 q for (const auto& j : i.second)
9212456 q {
9312456 q if (j.nds.empty())
940 continue;
9512456 q ids.push_back(j.nds.front());
9612456 q ids.push_back(j.nds.back());
9712456 q }
981967 q }
102std::vector< Node::Id_Type > way_nd_ids(
103 const std::map< Uint31_Index, std::vector< Way_Skeleton > >& ways,
104 const std::map< Uint31_Index, std::vector< Attic< Way_Skeleton > > >& attic_ways,
105 const std::vector< int >* pos)
1062561583 q{
1072561583 q std::vector< Node::Id_Type > ids;
1082561583 q if (pos)
109118 q way_nd_ids_pos(ways, *pos, ids);
1102560478 q else
1112560478 q way_nd_ids_plain(ways, ids);
1132561583 q if (!attic_ways.empty())
114168816 q {
115168816 q if (pos)
1160 way_nd_ids_pos(attic_ways, *pos, ids);
117168816 q else
118168816 q way_nd_ids_plain(attic_ways, ids);
119168816 q }
1212561583 q std::sort(ids.begin(), ids.end());
1222561583 q ids.erase(std::unique(ids.begin(), ids.end()), ids.end());
1242561583 q return ids;
1252561583 q}
128std::vector< Node::Id_Type > way_cnt_nd_ids(
129 const std::map< Uint31_Index, std::vector< Way_Skeleton > >& ways,
130 const std::map< Uint31_Index, std::vector< Attic< Way_Skeleton > > >& attic_ways,
131 unsigned int lower_limit, unsigned int upper_limit)
1332520 q std::vector< Node::Id_Type > ids;
1342520 q way_nd_ids_once(ways, ids);
1352520 q if (!attic_ways.empty())
13665 q way_nd_ids_once(attic_ways, ids);
1382520 q std::sort(ids.begin(), ids.end());
1402520 q decltype(ids.size()) lower = 0;
1412520 q decltype(ids.size()) upper = 0;
1422520 q decltype(ids.size()) target = 0;
1435157420 q while (lower < ids.size())
1445154913 q {
14510933013 q while (upper < ids.size() && ids[lower] == ids[upper])
1465778113 q ++upper;
1475154913 q if (lower_limit <= upper - lower && upper - lower <= upper_limit)
1484736711 q ids[target++] = ids[lower];
1495154913 q lower = upper;
1505154913 q }
1512520 q ids.resize(target);
1532520 q return ids;
157std::vector< Node::Id_Type > way_link_nd_ids(
158 const std::map< Uint31_Index, std::vector< Way_Skeleton > >& ways,
159 const std::map< Uint31_Index, std::vector< Attic< Way_Skeleton > > >& attic_ways,
160 unsigned int lower_limit, unsigned int upper_limit)
1622015 q std::vector< Node::Id_Type > ids;
1632015 q way_nd_ids_plain(ways, ids);
1642015 q if (!attic_ways.empty())
16565 q way_nd_ids_plain(attic_ways, ids);
1672015 q std::sort(ids.begin(), ids.end());
1692015 q std::vector< Node::Id_Type > fl_ids;
1702015 q way_nd_firstlast(ways, fl_ids);
1712015 q if (!attic_ways.empty())
17265 q way_nd_firstlast(attic_ways, fl_ids);
1742015 q std::sort(fl_ids.begin(), fl_ids.end());
1762015 q decltype(ids.size()) lower = 0;
1772015 q decltype(ids.size()) upper = 0;
1782015 q decltype(fl_ids.size()) fl_lower = 0;
1792015 q decltype(fl_ids.size()) fl_upper = 0;
1802015 q decltype(ids.size()) target = 0;
1811244915 q while (lower < ids.size())
182124296 q {
183269846 q while (upper < ids.size() && ids[lower] == ids[upper])
184145556 q ++upper;
185124296 q while (fl_lower < fl_ids.size() && fl_ids[fl_lower] < ids[lower])
1860 ++fl_lower;
187124296 q fl_upper = fl_lower;
188149196 q while (fl_upper < fl_ids.size() && fl_ids[fl_upper] == ids[lower])
18924906 q ++fl_upper;
190124296 q if (lower_limit <= 2*(upper - lower) + fl_lower - fl_upper
191124296 q && 2*(upper - lower) + fl_lower - fl_upper <= upper_limit)
19274026 q ids[target++] = ids[lower];
193124296 q lower = upper;
194124296 q fl_lower = fl_upper;
195124296 q }
1962015 q ids.resize(target);
1982015 q return ids;
202Ranges< Uint32_Index > calc_node_children_ranges(const std::vector< uint32 >& way_rel_idxs)
20359831501 q{
20459831501 q Ranges< Uint32_Index > result;
20659831501 q for (std::vector< uint32 >::const_iterator it = way_rel_idxs.begin();
2071513368501 q it != way_rel_idxs.end(); ++it)
2081453537364 q {
2091453537364 q if (*it & 0x80000000)
210132967331 q {
211132967331 q uint32 lat = 0;
212132967331 q uint32 lon = 0;
213132967331 q uint32 lat_u = 0;
214132967331 q uint32 lon_u = 0;
215132967331 q uint32 offset = 0;
217132967331 q if (*it & 0x00000001)
218128244330 q {
219128244330 q lat = upper_ilat(*it & 0x2aaaaaa8);
220128244330 q lon = upper_ilon(*it & 0x55555554);
221128244330 q offset = 2;
222128244330 q }
2234723148 q else if (*it & 0x00000002)
2244675143 q {
2254675143 q lat = upper_ilat(*it & 0x2aaaaa80);
2264675143 q lon = upper_ilon(*it & 0x55555540);
2274675143 q offset = 8;
2284675143 q }
2294810 q else if (*it & 0x00000004)
23141 q lat = upper_ilat(*it & 0x2aaaa800);
23241 q lon = upper_ilon(*it & 0x55555400);
23341 q offset = 0x20;
235449 q else if (*it & 0x00000008)
236123 q {
237123 q lat = upper_ilat(*it & 0x2aaa8000);
238123 q lon = upper_ilon(*it & 0x55554000);
239123 q offset = 0x80;
240123 q }
241326 q else if (*it & 0x00000010)
242205 q {
243205 q lat = upper_ilat(*it & 0x2aa80000);
244205 q lon = upper_ilon(*it & 0x55540000);
245205 q offset = 0x200;
246205 q }
247123 q else if (*it & 0x00000020)
248123 q {
249123 q lat = upper_ilat(*it & 0x2a800000);
250123 q lon = upper_ilon(*it & 0x55400000);
251123 q offset = 0x800;
252123 q }
2530 else if (*it & 0x00000040)
2540 {
2550 lat = upper_ilat(*it & 0x28000000);
2560 lon = upper_ilon(*it & 0x54000000);
2570 offset = 0x2000;
2580 }
2590 else // *it == 0x80000080
2600 {
2610 lat = 0;
2620 lon = 0;
2630 offset = 0x8000;
2640 }
266132967331 q result.push_back(ll_upper(lat<<16, lon<<16), ll_upper((lat+offset-1)<<16, (lon+offset-1)<<16)+1);
267132967331 q result.push_back(ll_upper(lat<<16, (lon+offset)<<16), ll_upper((lat+offset-1)<<16, (lon+2*offset-1)<<16)+1);
268132967331 q result.push_back(ll_upper((lat+offset)<<16, lon<<16), ll_upper((lat+2*offset-1)<<16, (lon+offset-1)<<16)+1);
269132967331 q result.push_back(
270132967331 q ll_upper((lat+offset)<<16, (lon+offset)<<16), ll_upper((lat+2*offset-1)<<16, (lon+2*offset-1)<<16)+1);
271132967331 q for (uint32 i = lat; i <= lat_u; ++i)
2720 {
2730 for (uint32 j = lon; j <= lon_u; ++j)
2740 result.push_back(ll_upper(i<<16, j<<16), ll_upper(i<<16, j<<16)+1);
2750 }
276132967331 q }
2771320570359 q else
2781320570359 q result.push_back(*it, (*it) + 1);
2791453537364 q }
28059831501 q result.sort();
28259831501 q return result;
28359831501 q}
286Ranges< Uint32_Index > relation_node_member_indices(
287 const std::map< Uint31_Index, std::vector< Relation_Skeleton > >& current_rels,
288 const std::map< Uint31_Index, std::vector< Attic< Relation_Skeleton > > >& attic_rels)
28927974473 q{
29027974473 q std::vector< uint32 > parents;
29271038473 q for (auto it = current_rels.begin(); it != current_rels.end(); ++it)
29343064181 q {
29443064181 q if ((it->first.val() & 0x80000000) && ((it->first.val() & 0x3) == 0))
2952471147 q {
296 // Treat relations with really large indices: get the node indexes from the segement indexes
29781124147 q for (auto it2 = it->second.begin(); it2 != it->second.end(); ++it2)
29878653123 q {
29978653123 q for (std::vector< Uint31_Index >::const_iterator it3 = it2->node_idxs.begin();
3001139244123 q it3 != it2->node_idxs.end(); ++it3)
3011060591116 q parents.push_back(it3->val());
30278653123 q }
3032471147 q }
30440593158 q else
30540593158 q parents.push_back(it->first.val());
30643064181 q }
30752764473 q for (auto it = attic_rels.begin(); it != attic_rels.end(); ++it)
3082479041 q {
3092479041 q if ((it->first.val() & 0x80000000) && ((it->first.val() & 0x3) == 0))
31075730 q {
311 // Treat relations with really large indices: get the node indexes from the segement indexes
312101030 q for (auto it2 = it->second.begin(); it2 != it->second.end(); ++it2)
31325312 q {
31425312 q for (std::vector< Uint31_Index >::const_iterator it3 = it2->node_idxs.begin();
315352912 q it3 != it2->node_idxs.end(); ++it3)
31632768 q parents.push_back(it3->val());
31725312 q }
31875730 q }
3192403328 q else
3202403328 q parents.push_back(it->first.val());
3212479041 q }
32327974473 q return calc_node_children_ranges(parents);
32427974473 q}
327Ranges< Uint31_Index > relation_way_member_indices
328 (const std::map< Uint31_Index, std::vector< Relation_Skeleton > >& current_rels,
329 const std::map< Uint31_Index, std::vector< Attic< Relation_Skeleton > > >& attic_rels)
33028110477 q{
33128110477 q std::vector< Uint31_Index > parents;
33228110477 q std::vector< Uint31_Index > children_idxs;
33476495477 q for (auto it = current_rels.begin(); it != current_rels.end(); ++it)
33548385183 q {
33648385183 q if ((it->first.val() & 0x80000000) && ((it->first.val() & 0x3) == 0))
3372558150 q {
338 // Treat relations with really large indices: get the ways indexes explicitly
33986648150 q for (auto it2 = it->second.begin(); it2 != it->second.end(); ++it2)
34084090126 q {
34184090126 q for (std::vector< Uint31_Index >::const_iterator it3 = it2->way_idxs.begin();
34215081575126 q it3 != it2->way_idxs.end(); ++it3)
34314997485121 q children_idxs.push_back(*it3);
34484090126 q }
3452558150 q }
34645827159 q else
34745827159 q parents.push_back(it->first);
34848385183 q }
34957571477 q for (auto it = attic_rels.begin(); it != attic_rels.end(); ++it)
3502946173 q {
3512946173 q if ((it->first.val() & 0x80000000) && ((it->first.val() & 0x3) == 0))
352165961 q {
353 // Treat relations with really large indices: get the ways indexes explicitly
3542758961 q for (auto it2 = it->second.begin(); it2 != it->second.end(); ++it2)
3552593044 q {
3562593044 q for (std::vector< Uint31_Index >::const_iterator it3 = it2->way_idxs.begin();
357456514044 q it3 != it2->way_idxs.end(); ++it3)
358453921044 q children_idxs.push_back(*it3);
3592593044 q }
360165961 q }
3612780258 q else
3622780258 q parents.push_back(it->first);
3632946173 q }
36528110477 q std::sort(children_idxs.begin(), children_idxs.end());
36628110477 q children_idxs.erase(std::unique(children_idxs.begin(), children_idxs.end()), children_idxs.end());
36828110477 q return collect_way_req(parents, children_idxs);
36928110477 q}
372Ranges< Uint31_Index > uint31_to_ranges(const std::vector< Uint31_Index >& arg)
3743524 q Ranges< Uint31_Index > result;
3753524 q for (auto i : arg)
3767657 q result.push_back(i, inc(i));
3773524 q return result;
381Ranges< Uint31_Index > collect_way_req(
382 const std::vector< Uint31_Index >& parents, const std::vector< Uint31_Index >& children_idxs)
38328110477 q{
38428110477 q Ranges< Uint31_Index > req = calc_children_(parents);
38628110477 q for (std::vector< Uint31_Index >::const_iterator it = children_idxs.begin();
3871779373477 q it != children_idxs.end(); ++it)
3881751263135 q req.push_back(*it, inc(*it));
39028110477 q req.sort();
39128110477 q return req;
39228110477 q}
395template< typename Index, typename Skeleton >
396std::vector< Index > get_indexes(
397 Request_Context& context, const std::vector< typename Skeleton::Id_Type >& ids)
39911 q std::vector< Index > result;
40111 q Random_File< typename Skeleton::Id_Type, Index > current(
40211 q context.random_index(current_skeleton_file_properties< Skeleton >()));
40321 q for (auto it = ids.begin(); it != ids.end(); ++it)
40411 q result.push_back(current.get(it->val()));
40611 q if (context.get_desired_timestamp() != NOW)
40811 q Random_File< typename Skeleton::Id_Type, Index > attic_random(
40911 q context.random_index(attic_skeleton_file_properties< Skeleton >()));
41011 q std::vector< typename Skeleton::Id_Type > idx_list_ids;
41121 q for (auto it = ids.begin(); it != ids.end(); ++it)
41311 q if (attic_random.get(it->val()).val() == 0)
4140 ;
41511 q else if (attic_random.get(it->val()) == 0xff)
4160 idx_list_ids.push_back(it->val());
41711 q else
41811 q result.push_back(attic_random.get(it->val()));
42111 q Block_Backend< typename Skeleton::Id_Type, Index > idx_list_db
42211 q (context.data_index(attic_idx_list_properties< Skeleton >()));
42311 q for (auto it = idx_list_db.discrete_begin(idx_list_ids.begin(), idx_list_ids.end());
42411 q !(it == idx_list_db.discrete_end()); ++it)
4250 result.push_back(it.object());
42811 q std::sort(result.begin(), result.end());
42911 q result.erase(std::unique(result.begin(), result.end()), result.end());
43111 q return result;
435Ranges< Uint31_Index > collect_relation_req(
436 Request_Context& context, const std::vector< Relation::Id_Type >& map_ids)
4383424 q std::vector< Uint31_Index > req;
4403424 q Random_File< Relation_Skeleton::Id_Type, Uint31_Index > random(
4413424 q context.random_index(osm_base_settings().RELATIONS));
4423424 q for (std::vector< Relation::Id_Type >::const_iterator
443581724 q it(map_ids.begin()); it != map_ids.end(); ++it)
44457837 q req.push_back(random.get(it->val()));
4463424 q std::sort(req.begin(), req.end());
4473424 q req.erase(unique(req.begin(), req.end()), req.end());
4493424 q return uint31_to_ranges(req);
453Ranges< Uint31_Index > collect_attic_relation_req(
454 Request_Context& context, const std::vector< Relation::Id_Type >& map_ids)
45611 q std::vector< Uint31_Index > req = get_indexes< Uint31_Index, Relation_Skeleton >(context, map_ids);
45711 q return uint31_to_ranges(req);
461Ranges< Uint31_Index > relation_relation_member_indices
462 (Request_Context& context,
463 const std::map< Uint31_Index, std::vector< Relation_Skeleton > >& current_rels,
464 const std::map< Uint31_Index, std::vector< Attic< Relation_Skeleton > > >& attic_rels)
4663424 q std::vector< Relation::Id_Type > map_ids;
468308924 q for (auto it = current_rels.begin(); it != current_rels.end(); ++it)
469 // Treat relations with really large indices: get the node indexes from nodes.std::map.
470305517 q filter_for_member_ids(it->second, map_ids, Relation_Entry::RELATION);
4723424 q std::sort(map_ids.begin(), map_ids.end());
4733424 q map_ids.erase(std::unique(map_ids.begin(), map_ids.end()), map_ids.end());
4743424 q context.get_health_guard().check();
4753424 q Ranges< Uint31_Index > current = collect_relation_req(context, map_ids);
4763424 q context.get_health_guard().check();
4783424 q map_ids.clear();
47921924 q for (auto it = attic_rels.begin(); it != attic_rels.end(); ++it)
480 // Treat relations with really large indices: get the node indexes from nodes.std::map.
4811855 q filter_for_member_ids(it->second, map_ids, Relation_Entry::RELATION);
4833424 q std::sort(map_ids.begin(), map_ids.end());
4843424 q map_ids.erase(std::unique(map_ids.begin(), map_ids.end()), map_ids.end());
4853424 q if (!map_ids.empty())
48711 q context.get_health_guard().check();
48811 q Ranges< Uint31_Index > attic = collect_attic_relation_req(context, map_ids);
48911 q return current.union_(attic);
4913324 q return current;
495Ranges< Uint32_Index > way_nd_indices(
496 const std::map< Uint31_Index, std::vector< Way_Skeleton > >& ways,
497 const std::map< Uint31_Index, std::vector< Attic< Way_Skeleton > > >& attic_ways)
49825655114 q{
49925655114 q std::vector< uint32 > parents;
50161877114 q for (auto it = ways.begin(); it != ways.end(); ++it)
5023622267 q {
5033622267 q if ((it->first.val() & 0x80000000) && ((it->first.val() & 0x1) == 0)) // Adapt 0x3
504148136 q {
505 // Treat ways with really large indices: get the node indexes from the segment indexes
506148136 q for (std::vector< Way_Skeleton >::const_iterator it2 = it->second.begin();
507452336 q it2 != it->second.end(); ++it2)
508304234 q {
509304234 q for (std::vector< Quad_Coord >::const_iterator it3 = it2->geometry.begin();
51031232634 q it3 != it2->geometry.end(); ++it3)
51130928434 q parents.push_back(it3->ll_upper);
512304234 q }
513148136 q }
5143474166 q else
5153474166 q parents.push_back(it->first.val());
5163622267 q }
51730422114 q for (auto it = attic_ways.begin(); it != attic_ways.end(); ++it)
518476724 q {
519476724 q if ((it->first.val() & 0x80000000) && ((it->first.val() & 0x1) == 0)) // Adapt 0x3
52012915 q {
521 // Treat ways with really large indices: get the node indexes from the segment indexes
52212915 q for (std::vector< Attic< Way_Skeleton > >::const_iterator it2 = it->second.begin();
52332015 q it2 != it->second.end(); ++it2)
52419112 q {
52519112 q for (std::vector< Quad_Coord >::const_iterator it3 = it2->geometry.begin();
5261659312 q it3 != it2->geometry.end(); ++it3)
5271640212 q parents.push_back(it3->ll_upper);
52819112 q }
52912915 q }
530463824 q else
531463824 q parents.push_back(it->first.val());
532476724 q }
53325655114 q std::sort(parents.begin(), parents.end());
53425655114 q parents.erase(unique(parents.begin(), parents.end()), parents.end());
53625655114 q return calc_node_children_ranges(parents);
53725655114 q}
540Ranges< Uint32_Index > way_covered_indices(
541 const std::map< Uint31_Index, std::vector< Way_Skeleton > >& ways,
542 const std::map< Uint31_Index, std::vector< Attic< Way_Skeleton > > >& attic_ways)
54426850 q std::vector< uint32 > parents;
54693750 q for (auto it = ways.begin(); it != ways.end(); ++it)
54766926 q parents.push_back(it->first.val());
54832350 q for (auto it = attic_ways.begin(); it != attic_ways.end(); ++it)
549555 q parents.push_back(it->first.val());
55126850 q std::sort(parents.begin(), parents.end());
55226850 q parents.erase(unique(parents.begin(), parents.end()), parents.end());
55426850 q return calc_node_children_ranges(parents);
558std::vector< Relation::Id_Type > relation_relation_member_ids(
559 const std::map< Uint31_Index, std::vector< Relation_Skeleton > >& rels,
560 const std::map< Uint31_Index, std::vector< Attic< Relation_Skeleton > > >& attic_rels,
561 const uint32* role_id)
5634428 q std::vector< Relation::Id_Type > ids;
5644428 q if (role_id)
56622 q for (auto it = rels.begin(); it != rels.end(); ++it)
5670 filter_for_member_ids(it->second, ids, Relation_Entry::RELATION, *role_id);
5694226 q else
571311926 q for (auto it = rels.begin(); it != rels.end(); ++it)
572307717 q filter_for_member_ids(it->second, ids, Relation_Entry::RELATION);
5754428 q if (role_id)
57722 q for (auto it = rels.begin(); it != rels.end(); ++it)
5780 filter_for_member_ids(it->second, ids, Relation_Entry::RELATION, *role_id);
579962 q for (auto it = attic_rels.begin(); it != attic_rels.end(); ++it)
580941 q filter_for_member_ids(it->second, ids, Relation_Entry::RELATION, *role_id);
5824226 q else
584311926 q for (auto it = rels.begin(); it != rels.end(); ++it)
585307717 q filter_for_member_ids(it->second, ids, Relation_Entry::RELATION);
58613326 q for (auto it = attic_rels.begin(); it != attic_rels.end(); ++it)
587914 q filter_for_member_ids(it->second, ids, Relation_Entry::RELATION);
5904428 q std::sort(ids.begin(), ids.end());
5924428 q return ids;
596template< typename Id_Type >
597void sieve_first_arg(
598 std::vector< Id_Type >& working_ids, const std::vector< Id_Type >& extra_ids, bool invert_ids)
59981600496 q{
60081600496 q std::vector< Id_Type > copy_ids = working_ids;
60181600496 q if (!invert_ids)
60277 q working_ids.erase(std::set_intersection
60377 q (extra_ids.begin(), extra_ids.end(), copy_ids.begin(), copy_ids.end(),
60477 q working_ids.begin()), working_ids.end());
60581593493 q else
60681593493 q working_ids.erase(std::set_difference
60781593493 q (copy_ids.begin(), copy_ids.end(), extra_ids.begin(), extra_ids.end(),
60881593493 q working_ids.begin()), working_ids.end());
60981600496 q}
612Timeless< Uint31_Index, Relation_Skeleton > relation_relation_members
613 (Request_Context& context,
614 const std::map< Uint31_Index, std::vector< Relation_Skeleton > >& parents,
615 const std::map< Uint31_Index, std::vector< Attic< Relation_Skeleton > > >& attic_parents,
616 const Ranges< Uint31_Index >& children_ranges,
617 const std::vector< Relation::Id_Type >& children_ids, bool invert_ids, const uint32* role_id)
6193727 q std::vector< Relation::Id_Type > intersect_ids = relation_relation_member_ids(parents, attic_parents, role_id);
6203727 q context.get_health_guard().check();
6213727 q sieve_first_arg(intersect_ids, children_ids, invert_ids);
6233727 q return collect_items_range< Uint31_Index, Relation_Skeleton >(context,
6243727 q children_ranges.is_global()
6253727 q ? relation_relation_member_indices(context, parents, attic_parents) : children_ranges,
6263727 q Id_Predicate< Relation_Skeleton >(intersect_ids));
630Timeless< Uint31_Index, Way_Skeleton > relation_way_members
631 (Request_Context& context,
632 const std::map< Uint31_Index, std::vector< Relation_Skeleton > >& relations,
633 const std::map< Uint31_Index, std::vector< Attic< Relation_Skeleton > > >& attic_relations,
634 const Ranges< Uint31_Index >& way_ranges,
635 const std::vector< Way::Id_Type >& way_ids, bool invert_ids, const uint32* role_id)
63627958477 q{
63727958477 q std::vector< Way::Id_Type > intersect_ids = relation_way_member_ids(relations, attic_relations, role_id);
63827958477 q context.get_health_guard().check();
63927958477 q sieve_first_arg(intersect_ids, way_ids, invert_ids);
64127958477 q return collect_items_range< Uint31_Index, Way_Skeleton >(context, way_ranges.intersect(
64227958477 q relation_way_member_indices(relations, attic_relations)),
64327958477 q Id_Predicate< Way_Skeleton >(intersect_ids));
64427958477 q}
647std::map< Uint31_Index, std::vector< Attic< Way_Skeleton > > > relation_way_members
648 (Request_Context& context,
649 const std::map< Uint31_Index, std::vector< Attic< Relation_Skeleton > > >& relations,
650 const Ranges< Uint31_Index >& way_ranges)
652147123 q std::vector< Way::Id_Type > intersect_ids = relation_way_member_ids({}, relations);
653147123 q context.get_health_guard().check();
655147123 q auto timeless = collect_items_range< Uint31_Index, Way_Skeleton >(context, way_ranges.intersect(
656147123 q relation_way_member_indices({}, relations)),
657147123 q Id_Predicate< Way_Skeleton >(intersect_ids));
659147123 q std::map< Uint31_Index, std::vector< Attic< Way_Skeleton > > > result;
660147123 q keep_matching_skeletons(result, timeless.current, timeless.attic, context.get_desired_timestamp());
661147123 q return result;
665Timeless< Uint32_Index, Node_Skeleton > paired_items_range(
666 Request_Context& context,
667 const std::vector< Node::Id_Type >& target_ids, const Ranges< Uint32_Index >& ranges)
66853605487 q{
66953605487 q auto result = collect_items_range< Uint32_Index, Node_Skeleton >(
67053605487 q context, ranges, Id_Predicate< Node_Skeleton >(target_ids));
67153605487 q keep_matching_skeletons(result.current, result.attic, context.get_desired_timestamp());
67353605487 q return result;
67453605487 q}
677Timeless< Uint32_Index, Node_Skeleton > relation_node_members
678 (Request_Context& context,
679 const std::map< Uint31_Index, std::vector< Relation_Skeleton > >& relations,
680 const std::map< Uint31_Index, std::vector< Attic< Relation_Skeleton > > >& attic_relations,
681 const Ranges< Uint32_Index >& node_ranges,
682 const std::vector< Node::Id_Type >& node_ids, bool invert_ids, const uint32* role_id)
68327950473 q{
68427950473 q std::vector< Node::Id_Type > intersect_ids = relation_node_member_ids(relations, attic_relations, role_id);
68527950473 q context.get_health_guard().check();
68627950473 q sieve_first_arg(intersect_ids, node_ids, invert_ids);
68827950473 q return paired_items_range(
68927950473 q context, intersect_ids, node_ranges.intersect(
69027950473 q relation_node_member_indices(relations, attic_relations)));
69127950473 q}
694std::map< Uint32_Index, std::vector< Attic< Node_Skeleton > > > relation_node_members
695 (Request_Context& context,
696 const std::map< Uint31_Index, std::vector< Attic< Relation_Skeleton > > >& relations,
697 const Ranges< Uint32_Index >& node_ranges)
699147123 q std::vector< Node::Id_Type > intersect_ids = relation_node_member_ids(relations, {});
700147123 q context.get_health_guard().check();
702 // Retrieve all nodes referred by the ways.
703147123 q auto timeless = collect_items_range< Uint32_Index, Node_Skeleton >(
704147123 q context, node_ranges, Id_Predicate< Node_Skeleton >(intersect_ids));
706147123 q std::map< Uint32_Index, std::vector< Attic< Node_Skeleton > > > result;
707147123 q keep_matching_skeletons(result, timeless.current, timeless.attic, context.get_desired_timestamp());
708147123 q return result;
712Timeless< Uint32_Index, Node_Skeleton > way_members(
713 Request_Context& context,
714 const std::map< Uint31_Index, std::vector< Way_Skeleton > >& ways,
715 const std::map< Uint31_Index, std::vector< Attic< Way_Skeleton > > >& attic_ways,
716 const std::vector< int >* pos,
717 const Ranges< Uint32_Index >& node_ranges,
718 const std::vector< Node::Id_Type >& node_ids, bool invert_ids)
7192561083 q{
7202561083 q std::vector< Node::Id_Type > intersect_ids = way_nd_ids(ways, attic_ways, pos);
7212561083 q context.get_health_guard().check();
7222561083 q sieve_first_arg(intersect_ids, node_ids, invert_ids);
7242561083 q return paired_items_range(context, intersect_ids,
7252561083 q !node_ranges.is_global() ? node_ranges : way_nd_indices(ways, attic_ways));
7262561083 q}
729Timeless< Uint32_Index, Node_Skeleton > way_cnt_members(
730 Request_Context& context,
731 const std::map< Uint31_Index, std::vector< Way_Skeleton > >& ways,
732 const std::map< Uint31_Index, std::vector< Attic< Way_Skeleton > > >& attic_ways,
733 unsigned int lower_limit, unsigned int upper_limit,
734 const Ranges< Uint32_Index >& node_ranges,
735 const std::vector< Node::Id_Type >& node_ids, bool invert_ids)
7372520 q std::vector< Node::Id_Type > intersect_ids = way_cnt_nd_ids(ways, attic_ways, lower_limit, upper_limit);
7382520 q context.get_health_guard().check();
7392520 q sieve_first_arg(intersect_ids, node_ids, invert_ids);
7412520 q return paired_items_range(context, intersect_ids,
7422520 q !node_ranges.is_global() ? node_ranges : way_nd_indices(ways, attic_ways));
746Timeless< Uint32_Index, Node_Skeleton > way_link_members(
747 Request_Context& context,
748 const std::map< Uint31_Index, std::vector< Way_Skeleton > >& ways,
749 const std::map< Uint31_Index, std::vector< Attic< Way_Skeleton > > >& attic_ways,
750 unsigned int lower_limit, unsigned int upper_limit,
751 const Ranges< Uint32_Index >& node_ranges,
752 const std::vector< Node::Id_Type >& node_ids, bool invert_ids)
7542015 q std::vector< Node::Id_Type > intersect_ids = way_link_nd_ids(ways, attic_ways, lower_limit, upper_limit);
7552015 q context.get_health_guard().check();
7562015 q sieve_first_arg(intersect_ids, node_ids, invert_ids);
7582015 q return paired_items_range(context, intersect_ids,
7592015 q !node_ranges.is_global() ? node_ranges : way_nd_indices(ways, attic_ways));
762//-----------------------------------------------------------------------------
764const std::map< uint32, std::string >& relation_member_roles(Transaction& transaction)
76528542664 q{
76628542664 q static std::map< uint32, std::string > roles;
76828542664 q if (roles.empty())
770664664 q Block_Backend< Uint32_Index, String_Object > roles_db
771664664 q (transaction.data_index(osm_base_settings().RELATION_ROLES));
772664664 q for (Block_Backend< Uint32_Index, String_Object >::Flat_Iterator
773898392664 q it(roles_db.flat_begin()); !(it == roles_db.flat_end()); ++it)
774897728664 q roles[it.index().val()] = it.object().val();
77728542664 q return roles;
77828542664 q}
781uint32 determine_role_id(Transaction& transaction, const std::string& role)
7833424 q const std::map< uint32, std::string >& roles = relation_member_roles(transaction);
784524624 q for (std::map< uint32, std::string >::const_iterator it = roles.begin(); it != roles.end(); ++it)
785524624 q {
786524624 q if (it->second == role)
7873424 q return it->first;
788524624 q }
7890 return std::numeric_limits< uint32 >::max();
793//-----------------------------------------------------------------------------
796bool add_way_to_area_blocks(const std::vector< Quad_Coord >& coords,
797 uint32 id, std::map< Uint31_Index, std::vector< Area_Block > >& areas)
798104931465 q{
799104931465 q bool wraps_around_date_line = false;
801104931465 q if (coords.size() < 2)
802602 q return false;
804104925465 q uint32 cur_idx = 0;
805104925465 q std::vector< uint64 > cur_polyline;
8061155454165 q for (std::vector< Quad_Coord >::const_iterator it = coords.begin(); it != coords.end(); ++it)
8071050528765 q {
8081050528765 q if ((it->ll_upper & 0xffffff00) != cur_idx)
809111093565 q {
810111093565 q if (cur_idx != 0)
8116166960 q {
8126166960 q if (cur_polyline.size() > 1)
8135125559 q areas[cur_idx].push_back(Area_Block(id, cur_polyline));
8156166960 q std::vector< Aligned_Segment > aligned_segments;
8166166960 q wraps_around_date_line ^= Area::calc_aligned_segments
8176166960 q (aligned_segments, cur_polyline.back(),
8186166960 q ((uint64)it->ll_upper<<32) | it->ll_lower);
8196166960 q cur_polyline.clear();
8206166960 q for (std::vector< Aligned_Segment >::const_iterator
82123575460 q it(aligned_segments.begin()); it != aligned_segments.end(); ++it)
82217408560 q {
82317408560 q cur_polyline.push_back((((uint64)it->ll_upper_)<<32) | it->ll_lower_a);
82417408560 q cur_polyline.push_back((((uint64)it->ll_upper_)<<32) | it->ll_lower_b);
82517408560 q areas[it->ll_upper_].push_back(Area_Block(id, cur_polyline));
82617408560 q cur_polyline.clear();
82717408560 q }
8286166960 q }
829111093565 q cur_idx = (it->ll_upper & 0xffffff00);
830111093565 q }
8311050528765 q cur_polyline.push_back(((uint64)it->ll_upper<<32) | it->ll_lower);
8321050528765 q }
833104925465 q if ((cur_idx != 0) && (cur_polyline.size() > 1))
834104301962 q areas[cur_idx].push_back(Area_Block(id, cur_polyline));
836104925465 q return wraps_around_date_line;
837104931465 q}
840std::vector< Quad_Coord > make_geometry(const Way_Skeleton& way, const std::vector< Node >& nodes)
8417036703328 q{
8427036703328 q std::vector< Quad_Coord > result;
8447036703328 q for (std::vector< Node::Id_Type >::const_iterator it3(way.nds.begin());
84564387861328 q it3 != way.nds.end(); ++it3)
84657351662328 q {
84757351662328 q const Node* node = binary_search_for_id(nodes, *it3);
84857351662328 q if (node == 0)
84950418 q {
85050418 q result.clear();
85150418 q return result;
85250418 q }
85357351158328 q result.push_back(Quad_Coord(node->index, node->ll_lower_));
85457351158328 q }
8567036199328 q return result;
8577036703328 q}
860std::vector< Uint31_Index > segment_idxs(const std::vector< Quad_Coord >& geometry)
861215558223 q{
862215558223 q std::vector< uint32 > nd_idxs;
86424718761223 q for (std::vector< Quad_Coord >::const_iterator it = geometry.begin(); it != geometry.end(); ++it)
86524503203223 q nd_idxs.push_back(it->ll_upper);
867215558223 q return calc_segment_idxs(nd_idxs);
868215558223 q}
871template< typename Object >
872void filter_ways_by_ranges_generic
873 (std::map< Uint31_Index, std::vector< Object > >& ways,
874 const Ranges< Uint31_Index >& ranges)
8761051376 q auto ranges_it = ranges.begin();
8771051376 q typename std::map< Uint31_Index, std::vector< Object > >::iterator it = ways.begin();
8781051376 q auto ranges_begin = ranges.begin();
879238172376 q for (; it != ways.end() && ranges_it != ranges.end(); )
880237121244 q {
881237121244 q if (!(it->first < ranges_it.upper_bound()))
88247291237 q ++ranges_it;
883189830243 q else if (!(it->first < ranges_it.lower_bound()))
884189830243 q {
885189830243 q if ((it->first.val() & 0x80000000) == 0 || (it->first.val() & 0x1) != 0) // Adapt 0x3
886177678229 q ++it;
88712152233 q else
88812152233 q {
88912152233 q std::vector< Object > filtered_ways;
89054576233 q while (!(Uint31_Index(it->first.val() & 0x7fffff00) < ranges_begin.upper_bound()))
89142424226 q ++ranges_begin;
89212152233 q for (typename std::vector< Object >::const_iterator it2 = it->second.begin();
893227710233 q it2 != it->second.end(); ++it2)
894215558223 q {
895215558223 q auto ranges_it2 = ranges_begin;
896215558223 q std::vector< Uint31_Index > segment_idxs_ = segment_idxs(it2->geometry);
897215558223 q for (std::vector< Uint31_Index >::const_iterator it3 = segment_idxs_.begin();
8981894447223 q it3 != segment_idxs_.end() && ranges_it2 != ranges.end(); )
8991844597223 q {
9001844597223 q if (!(*it3 < ranges_it2.upper_bound()))
901858617216 q ++ranges_it2;
902985980223 q else if (!(*it3 < ranges_it2.lower_bound()))
903165708219 q {
904 // A relevant index is found; thus the way is relevant.
905165708219 q filtered_ways.push_back(*it2);
906165708219 q break;
907165708219 q }
908820272209 q else
909820272209 q ++it3;
9101844597223 q }
911215558223 q }
91312152233 q filtered_ways.swap(it->second);
91412152233 q ++it;
91512152233 q }
916189830243 q }
9170 else
9180 {
919 // The index of the way is not in the current set of ranges.
920 // Thus it cannot be in the result set.
9210 it->second.clear();
9220 ++it;
9230 }
924237121244 q }
9251188376 q for (; it != ways.end(); ++it)
9261372 q it->second.clear();
930void filter_ways_by_ranges(std::map< Uint31_Index, std::vector< Way_Skeleton > >& ways,
931 const Ranges< Uint31_Index >& ranges)
933568376 q filter_ways_by_ranges_generic(ways, ranges);
937void filter_ways_by_ranges(std::map< Uint31_Index, std::vector< Attic< Way_Skeleton > > >& ways,
938 const Ranges< Uint31_Index >& ranges)
940483326 q filter_ways_by_ranges_generic(ways, ranges);
944void keep_matching_skeletons
945 (std::vector< Node >& result,
946 const std::map< Uint32_Index, std::vector< Node_Skeleton > >& current,
947 const std::map< Uint32_Index, std::vector< Attic< Node_Skeleton > > >& attic,
948 uint64 timestamp)
9502036262 q std::map< Node_Skeleton::Id_Type, uint64 > timestamp_by_id;
9522036262 q result.clear();
9542036262 q for (std::map< Uint32_Index, std::vector< Node_Skeleton > >::const_iterator it = current.begin();
95587289262 q it != current.end(); ++it)
95685253126 q {
9571953334126 q for (std::vector< Node_Skeleton >::const_iterator it2 = it->second.begin(); it2 != it->second.end(); ++it2)
9581868081124 q timestamp_by_id[it2->id] = NOW;
95985253126 q }
9612036262 q for (std::map< Uint32_Index, std::vector< Attic< Node_Skeleton > > >::const_iterator it = attic.begin();
96287289262 q it != attic.end(); ++it)
96385253126 q {
96485253126 q for (std::vector< Attic<Node_Skeleton > >::const_iterator it2 = it->second.begin();
9651381077126 q it2 != it->second.end(); ++it2)
9661295824126 q {
9671295824126 q uint64& stored_timestamp = timestamp_by_id[it2->id];
9681295824126 q if (it2->timestamp > timestamp && (stored_timestamp == 0 || stored_timestamp > it2->timestamp))
9691291516126 q stored_timestamp = it2->timestamp;
9701295824126 q }
97185253126 q }
9732036262 q for (std::map< Uint32_Index, std::vector< Node_Skeleton > >::const_iterator it = current.begin();
97487289262 q it != current.end(); ++it)
97585253126 q {
9761953334126 q for (std::vector< Node_Skeleton >::const_iterator it2 = it->second.begin(); it2 != it->second.end(); ++it2)
9771868081124 q {
9781868081124 q if (timestamp_by_id[it2->id] == NOW)
9791854043123 q result.push_back(Node(it2->id, it->first.val(), it2->ll_lower));
9801868081124 q }
98185253126 q }
9832036262 q for (std::map< Uint32_Index, std::vector< Attic< Node_Skeleton > > >::const_iterator it = attic.begin();
98487289262 q it != attic.end(); ++it)
98585253126 q {
98685253126 q for (std::vector< Attic<Node_Skeleton > >::const_iterator it2 = it->second.begin();
9871381077126 q it2 != it->second.end(); ++it2)
9881295824126 q {
9891295824126 q if (timestamp_by_id[it2->id] == it2->timestamp)
9901286433126 q result.push_back(Node(it2->id, it->first.val(), it2->ll_lower));
9911295824126 q }
99285253126 q }
9942036262 q std::sort(result.begin(), result.end(), Node_Comparator_By_Id());
998Timeless< Uint31_Index, Way_Skeleton > collect_ways(
999 Request_Context& context,
1000 const std::map< Uint31_Index, std::vector< Relation_Skeleton > >& rels,
1001 const std::map< Uint31_Index, std::vector< Attic< Relation_Skeleton > > >& attic_rels,
1002 const Ranges< Uint31_Index >& ranges,
1003 const std::vector< Way::Id_Type >& ids, bool invert_ids,
1004 uint32* role_id)
100655 q return relation_way_members(context, rels, attic_rels, ranges, ids, invert_ids, role_id);
1010Timeless< Uint31_Index, Way_Skeleton > collect_ways(
1011 Request_Context& context,
1012 const std::map< Uint32_Index, std::vector< Node_Skeleton > >& nodes,
1013 const std::map< Uint32_Index, std::vector< Attic< Node_Skeleton > > >& attic_nodes,
1014 const std::vector< int >* pos,
1015 const std::vector< Way::Id_Type >& ids, bool invert_ids)
101715179 q Timeless< Uint31_Index, Way_Skeleton > result;
101815179 q std::vector< Uint64 > children_ids;
101915179 q std::set< Uint31_Index > req;
102115179 q if (context.get_desired_timestamp() == NOW)
102310847 q extract_ids(nodes).swap(children_ids);
102410847 q extract_parent_indices(nodes).swap(req);
10264338 q else
10284338 q std::vector< Uint64 > current_ids = extract_ids(nodes);
10294338 q extract_parent_indices(nodes).swap(req);
10314338 q std::vector< Uint64 > attic_ids = extract_ids(attic_nodes);
10324338 q std::set< Uint31_Index > attic_req = extract_parent_indices(attic_nodes);
10344338 q std::set_union(current_ids.begin(), current_ids.end(), attic_ids.begin(), attic_ids.end(),
10354338 q std::back_inserter(children_ids));
1036456438 q for (std::set< Uint31_Index >::const_iterator it = attic_req.begin(); it != attic_req.end(); ++it)
1037452138 q req.insert(*it);
104015179 q if (!invert_ids)
104155 q collect_items_discrete(context, req,
104255 q And_Predicate< Way_Skeleton,
104355 q Id_Predicate< Way_Skeleton >, Get_Parent_Ways_Predicate >
104455 q (Id_Predicate< Way_Skeleton >(ids), Get_Parent_Ways_Predicate(children_ids, pos)),
104555 q result.current, result.attic);
104614674 q else if (ids.empty())
104714674 q collect_items_discrete(context, req,
104814674 q Get_Parent_Ways_Predicate(children_ids, pos), result.current, result.attic);
10490 else
10500 collect_items_discrete(context, req,
10510 And_Predicate< Way_Skeleton,
10520 Not_Predicate< Way_Skeleton, Id_Predicate< Way_Skeleton > >,
10530 Get_Parent_Ways_Predicate >
10540 (Not_Predicate< Way_Skeleton, Id_Predicate< Way_Skeleton > >
10550 (Id_Predicate< Way_Skeleton >(ids)),
10560 Get_Parent_Ways_Predicate(children_ids, pos)),
10570 result.current, result.attic);
105915179 q return result;
1063void add_nw_member_objects(Request_Context& context, const Set& input_set, Set& into,
1064 const Ranges< Uint32_Index >* ranges_32_, const Ranges< Uint31_Index >* ranges_31_)
10652556045 q{
10662556045 q Ranges< Uint32_Index > ranges_32(ranges_32_ ? *ranges_32_ : Ranges< Uint32_Index >::global());
10672556045 q Ranges< Uint31_Index > ranges_31(ranges_31_ ? *ranges_31_ : Ranges< Uint31_Index >::global());
10682556045 q Timeless< Uint32_Index, Node_Skeleton > rel_nodes
10692556045 q = relation_node_members(context, input_set.relations, input_set.attic_relations, ranges_32, {}, true);
10712556045 q if (context.get_desired_timestamp() == NOW)
10735226 q relation_way_members(context, input_set.relations, {}, ranges_31, {}, true)
10745226 q .swap(into.ways, into.attic_ways);
10755226 q std::map< Uint31_Index, std::vector< Way_Skeleton > > source_ways = input_set.ways;
10765226 q sort_second(source_ways);
10775226 q sort_second(into.ways);
10785226 q indexed_set_union(source_ways, into.ways);
10795226 q way_members(context, source_ways, {}, 0, Ranges< Uint32_Index >::global(), {}, true)
10805226 q .swap(into.nodes, into.attic_nodes);
10815226 q sort_second(into.nodes);
10825226 q sort_second(rel_nodes.current);
10835226 q indexed_set_union(into.nodes, rel_nodes.current);
10852550820 q else
10862550820 q {
10872550820 q rel_nodes.swap(into.nodes, into.attic_nodes);
10892550820 q Timeless< Uint31_Index, Way_Skeleton > all_ways
10902550820 q = relation_way_members(context, input_set.relations, input_set.attic_relations, ranges_31, {}, true);
10912550820 q into.ways = all_ways.current;
10922550820 q into.attic_ways = all_ways.attic;
10932550820 q all_ways.sort();
10952550820 q std::map< Uint31_Index, std::vector< Way_Skeleton > > source_ways = input_set.ways;
10962550820 q std::map< Uint31_Index, std::vector< Attic< Way_Skeleton > > > source_attic_ways = input_set.attic_ways;
10972550820 q sort_second(source_ways);
10982550820 q sort_second(source_attic_ways);
10992550820 q indexed_set_union(all_ways.current, source_ways);
11002550820 q indexed_set_union(all_ways.attic, source_attic_ways);
11022550820 q Timeless< Uint32_Index, Node_Skeleton > more_nodes
11032550820 q = way_members(context, all_ways.current, all_ways.attic, 0, Ranges< Uint32_Index >::global(), {}, true);
11042550820 q more_nodes.sort();
11052550820 q sort_second(into.nodes);
11062550820 q sort_second(into.attic_nodes);
11072550820 q indexed_set_union(into.nodes, more_nodes.current);
11082550820 q indexed_set_union(into.attic_nodes, more_nodes.attic);
11092550820 q keep_matching_skeletons(into.nodes, into.attic_nodes, context.get_desired_timestamp());
11102550820 q }
11112556045 q}