| 306 | |
| 307 | |
| 308 | void 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 |
no test coverage detected