MCPcopy Create free account
hub / github.com/PDAL/PDAL / run

Method run

filters/GridDecimationFilter.cpp:161–193  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

159}
160
161PointViewSet GridDecimationFilter::run(PointViewPtr view)
162{
163 PointViewSet viewSet;
164
165 BOX2D bounds;
166 view->calculateBounds(bounds);
167 createGrid(bounds);
168
169 for (PointId i = 0; i < view->size(); ++i)
170 {
171 PointRef point = view->point(i);
172 processOne(bounds,point,view);
173 }
174
175 std::set<PointId> keepPoint;
176 for (auto it : this->grid)
177 if (it.second != -1)
178 keepPoint.insert(it.second);
179
180 for (PointId i = 0; i < view->size(); ++i)
181 {
182 if (keepPoint.find(view->point(i).pointId()) != keepPoint.end())
183 {
184 PointRef point = view->point(i);
185 for (expr::AssignStatement& expr : m_args->m_statements)
186 if (expr.conditionalExpr().eval(point))
187 point.setField(expr.identExpr().eval(), expr.valueExpr().eval(point));
188 }
189 }
190
191 viewSet.insert(view);
192 return viewSet;
193}
194
195} // namespace pdal

Callers

nothing calls this directly

Calls 9

processOneFunction · 0.85
calculateBoundsMethod · 0.80
pointMethod · 0.80
sizeMethod · 0.45
insertMethod · 0.45
findMethod · 0.45
endMethod · 0.45
evalMethod · 0.45
setFieldMethod · 0.45

Tested by

no test coverage detected