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

Method dump

kernels/InfoKernel.cpp:308–370  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

306
307
308void InfoKernel::dump(MetadataNode& root)
309{
310 if (m_pipelineFile.size() > 0)
311 PipelineWriter::writePipeline(m_manager.getStage(), m_pipelineFile);
312
313 // Reader stage.
314 if (m_showMetadata)
315 root.add(m_reader->getMetadata().clone("metadata"));
316
317 // Info stage.
318 auto info = dynamic_cast<InfoFilter *>(m_infoStage);
319 MetadataNode infoMeta = info->getMetadata();
320 MetadataNode points = infoMeta.findChild("points");
321 if (points)
322 root.add(points);
323
324 if (m_showSchema)
325 root.add(infoMeta.findChild("schema"));
326
327 // Stats stage.
328 if (m_showStats)
329 {
330 MetadataNode stats = root.add(m_statsStage->getMetadata().clone("stats"));
331 if (m_breakoutDimension.size())
332 stats.add(m_expressionStatsStage->getMetadata().clone("breakout"));
333 }
334
335 // Hexbin stage.
336 if (m_hexbinStage)
337 {
338 MetadataNode node = m_hexbinStage->getMetadata();
339 if (node.findChild("error"))
340 {
341 std::string poly = info->bounds().to2d().toWKT();
342 std::string poly_geojson = info->bounds().to2d().toGeoJSON();
343
344 MetadataNode m("boundary");
345 m.add("boundary", poly, "Simple boundary of polygon");
346 m.add("boundary_json", poly_geojson, "Simple boundary of polygon");
347 root.add(m);
348 }
349 else
350 root.add(m_hexbinStage->getMetadata().clone("boundary"));
351 }
352
353 // STAC stage.
354 if (m_stac)
355 {
356 MetadataNode statsMeta;
357 if (!m_showStats)
358 statsMeta = m_stacStage->getMetadata();
359 else
360 statsMeta = root.findChild("stats");
361
362 MetadataNode readerMeta;
363 if (!m_showMetadata)
364 readerMeta = m_reader->getMetadata().clone("metadata");
365 else

Callers 1

executeMethod · 0.45

Calls 8

writePipelineFunction · 0.85
addStacMetadataFunction · 0.85
to2dMethod · 0.80
sizeMethod · 0.45
addMethod · 0.45
getMetadataMethod · 0.45
toWKTMethod · 0.45
boundsMethod · 0.45

Tested by

no test coverage detected