| 644 | |
| 645 | |
| 646 | void CopcReader::ready(PointTableRef table) |
| 647 | { |
| 648 | // We may need to reset these after initialize(), since the reader could be being run |
| 649 | // multiple times without re-initializing. |
| 650 | if (m_p->done) |
| 651 | { |
| 652 | m_p->pool.reset(new ThreadPool(m_args->threads)); |
| 653 | m_p->connector.reset(new connector::Connector(m_filespec)); |
| 654 | } |
| 655 | |
| 656 | // Determine all overlapping data files we'll need to fetch. |
| 657 | try |
| 658 | { |
| 659 | loadHierarchy(); |
| 660 | } |
| 661 | catch (std::exception& e) |
| 662 | { |
| 663 | throwError(e.what()); |
| 664 | } |
| 665 | |
| 666 | m_p->loader.init(m_p->header.pointFormat(), m_p->scaling, m_p->extraDims); |
| 667 | |
| 668 | point_count_t totalPoints = 0; |
| 669 | for (const copc::Entry& entry : m_p->hierarchy) |
| 670 | totalPoints += entry.m_pointCount; |
| 671 | |
| 672 | if (totalPoints > 1e8) |
| 673 | log()->get(LogLevel::Warning) << totalPoints << " points will be downloaded" << std::endl; |
| 674 | |
| 675 | m_p->tileCount = m_p->hierarchy.size(); |
| 676 | log()->get(LogLevel::Debug) << m_p->tileCount << " overlapping nodes" << std::endl; |
| 677 | |
| 678 | m_p->done = false; |
| 679 | for (const copc::Entry& entry : m_p->hierarchy) |
| 680 | load(entry); |
| 681 | } |
| 682 | |
| 683 | |
| 684 | void CopcReader::loadHierarchy() |