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

Method BuildFromWay

generator/feature_maker.cpp:93–122  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

91}
92
93bool FeatureMakerSimple::BuildFromWay(OsmElement & p, FeatureBuilderParams const & params)
94{
95 auto const & nodes = p.Nodes();
96 if (nodes.size() < 2)
97 return false;
98
99 FeatureBuilder fb;
100
101 std::vector<m2::PointD> points;
102 points.reserve(nodes.size());
103 for (uint64_t ref : nodes)
104 {
105 m2::PointD pt;
106 if (!m_cache->GetNode(ref, pt.y, pt.x))
107 return false;
108 points.push_back(pt);
109 }
110 fb.AssignPoints(std::move(points));
111
112 fb.SetOsmId(base::MakeOsmWay(p.m_id));
113 fb.SetParams(params);
114
115 if (fb.IsGeometryClosed())
116 fb.SetArea();
117 else
118 fb.SetLinear(params.GetReversedGeometry());
119
120 m_queue.push(std::move(fb));
121 return true;
122}
123
124bool FeatureMakerSimple::BuildFromRelation(OsmElement & p, FeatureBuilderParams const & params)
125{

Callers

nothing calls this directly

Calls 14

MakeOsmWayFunction · 0.85
NodesMethod · 0.80
IsGeometryClosedMethod · 0.80
SetAreaMethod · 0.80
SetLinearMethod · 0.80
GetReversedGeometryMethod · 0.80
pushMethod · 0.80
sizeMethod · 0.45
reserveMethod · 0.45
GetNodeMethod · 0.45
push_backMethod · 0.45
AssignPointsMethod · 0.45

Tested by

no test coverage detected