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

Method processOne

io/Ilvis2Reader.cpp:226–273  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

224
225
226bool Ilvis2Reader::processOne(PointRef& point)
227{
228 std::string line;
229
230// Format:
231// LVIS_LFID SHOTNUMBER TIME LONGITUDE_CENTROID LATITUDE_CENTROID ELEVATION_CENTROID LONGITUDE_LOW LATITUDE_LOW ELEVATION_LOW LONGITUDE_HIGH LATITUDE_HIGH ELEVATION_HIGH
232
233 try
234 {
235 // This handles the second time through for this data line when we have
236 // an "ALL" mapping and the high and low elevations are different.
237 if (m_resample)
238 {
239 readPoint(point, m_fields, "HIGH");
240 m_resample = false;
241 return true;
242 }
243
244 if (!std::getline(*m_stream, line))
245 return false;
246 m_fields = Utils::split2(line, ' ');
247 if (m_fields.size() != 12)
248 throwError("Invalid format for line " +
249 Utils::toString(m_lineNum) + ". Expected 12 fields, got " +
250 Utils::toString(m_fields.size()) + ".");
251
252 double low_elev = convert<double>(m_fields, "ELEVATION_LOW", 8);
253 double high_elev = convert<double>(m_fields, "ELEVATION_HIGH", 11);
254
255 // write LOW point if specified, or for ALL
256 if (m_mapping == IlvisMapping::LOW || m_mapping == IlvisMapping::ALL)
257 {
258 readPoint(point, m_fields, "LOW");
259 // If we have ALL mapping and the high elevation is different
260 // from that of the low elevation, we'll a second point with the
261 // high elevation.
262 if (m_mapping == IlvisMapping::ALL && (low_elev != high_elev))
263 m_resample = true;
264 }
265 else if (m_mapping == IlvisMapping::HIGH)
266 readPoint(point, m_fields, "HIGH");
267 }
268 catch (const error& err)
269 {
270 throwError(err.what());
271 }
272 return true;
273}
274
275
276point_count_t Ilvis2Reader::read(PointViewPtr view, point_count_t count)

Callers

nothing calls this directly

Calls 3

toStringFunction · 0.70
sizeMethod · 0.45
whatMethod · 0.45

Tested by

no test coverage detected