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

Method processOne

filters/DEMFilter.cpp:109–131  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

107
108
109bool DEMFilter::processOne(PointRef& point)
110{
111 static std::vector<double> data;
112 static std::array<double, 2> pix;
113
114 double x = point.getFieldAs<double>(Dimension::Id::X);
115 double y = point.getFieldAs<double>(Dimension::Id::Y);
116 double z = point.getFieldAs<double>(m_args->m_dim);
117
118 bool passes(false);
119
120 if (m_raster->read(x, y, data, pix) == gdal::GDALError::None)
121 {
122 double v = data[m_args->m_band-1];
123 double lb = v - m_args->m_range.m_lower_bound;
124 double ub = v + m_args->m_range.m_upper_bound;
125
126
127 if ( z >= lb && z <= ub)
128 passes = true;
129 }
130 return passes;
131}
132
133PointViewSet DEMFilter::run(PointViewPtr inView)
134{

Callers

nothing calls this directly

Calls 1

readMethod · 0.45

Tested by

no test coverage detected