| 91 | } |
| 92 | |
| 93 | bool 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 | |
| 124 | bool FeatureMakerSimple::BuildFromRelation(OsmElement & p, FeatureBuilderParams const & params) |
| 125 | { |
nothing calls this directly
no test coverage detected