MCPcopy Create free account
hub / github.com/comaps/comaps / BuildFromRelation

Method BuildFromRelation

generator/feature_maker.cpp:124–151  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

122}
123
124bool FeatureMakerSimple::BuildFromRelation(OsmElement & p, FeatureBuilderParams const & params)
125{
126 HolesRelation helper(m_cache);
127 helper.Build(&p);
128 auto const & holesGeometry = helper.GetHoles();
129 auto const size = m_queue.size();
130
131 auto const createFB = [&](auto && pts, auto const & ids)
132 {
133 FeatureBuilder fb;
134
135 fb.AssignArea(std::move(pts), holesGeometry);
136 CHECK(fb.IsGeometryClosed(), ());
137
138 for (uint64_t id : ids)
139 fb.AddOsmId(base::MakeOsmWay(id));
140 fb.AddOsmId(base::MakeOsmRelation(p.m_id));
141
142 fb.SetParams(params);
143 fb.SetArea();
144
145 m_queue.push(std::move(fb));
146 };
147
148 helper.GetOuter().ForEachArea(true /* collectID */, [&](auto && pts, auto && ids) { createFB(std::move(pts), ids); });
149
150 return size != m_queue.size();
151}
152
153FeatureMaker::FeatureMaker(IDRInterfacePtr const & cache) : FeatureMakerSimple(cache)
154{

Callers

nothing calls this directly

Calls 15

MakeOsmWayFunction · 0.85
MakeOsmRelationFunction · 0.85
GetEmptyValueFunction · 0.85
GetPlaceNodeFromMembersFunction · 0.85
CalcRectFunction · 0.85
AssignAreaMethod · 0.80
IsGeometryClosedMethod · 0.80
AddOsmIdMethod · 0.80
SetAreaMethod · 0.80
pushMethod · 0.80
ForEachAreaMethod · 0.80
FindTypeMethod · 0.80

Tested by

no test coverage detected