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

Method getFileInfo

kernels/TIndexKernel.cpp:645–686  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

643
644
645void TIndexKernel::getFileInfo(FileInfo& fileInfo)
646{
647 PipelineManager manager;
648 manager.commonOptions() = m_manager.commonOptions();
649 manager.stageOptions() = m_manager.stageOptions();
650
651 // Need to make sure options get set.
652 Stage& reader = manager.makeReader(fileInfo.m_filename, "");
653
654 // If we aren't able to make a hexbin filter, we
655 // will just do a simple fast_boundary.
656 bool fast(m_fastBoundary);
657 if (!fast)
658 {
659 TindexBoundary hexer{m_density, m_edgeLength, m_sampleSize};
660 if (m_boundaryExpr.size())
661 {
662 Options opts;
663 opts.add("where", m_boundaryExpr);
664 hexer.addOptions(opts);
665 }
666 hexer.setInput(reader);
667 manager.addStage(&hexer);
668 try
669 {
670 manager.execute(ExecMode::PreferStream);
671
672 fileInfo.m_boundary = hexer.toWKT();
673 fileInfo.m_srs = hexer.getSpatialReference().getWKT();
674 fileInfo.m_gridHeight = hexer.height();
675 }
676 catch(pdal_error& e)
677 {
678 fast = true;
679 m_log->get(LogLevel::Warning) << "Unable to create exact boundary for tile " <<
680 fileInfo.m_filename << " with error: '" << e.what() << std::endl;
681 }
682 }
683
684 if (fast)
685 fastBoundary(reader, fileInfo);
686}
687
688
689bool TIndexKernel::openDataset(const std::string& filename)

Callers

nothing calls this directly

Calls 12

stageOptionsMethod · 0.80
makeReaderMethod · 0.80
addStageMethod · 0.80
getWKTMethod · 0.80
getSpatialReferenceMethod · 0.80
sizeMethod · 0.45
addMethod · 0.45
executeMethod · 0.45
toWKTMethod · 0.45
heightMethod · 0.45
getMethod · 0.45
whatMethod · 0.45

Tested by

no test coverage detected