| 457 | } |
| 458 | |
| 459 | void StacReader::initialize() |
| 460 | { |
| 461 | m_p->m_connector.reset(new connector::Connector(m_filespec)); |
| 462 | |
| 463 | m_p->m_pool.reset(new ThreadPool(m_p->m_args->threads)); |
| 464 | m_p->setLog(log()); |
| 465 | m_p->initializeArgs(); |
| 466 | |
| 467 | NL::json stacJson = m_p->m_connector->getJson(m_filename); |
| 468 | |
| 469 | std::string stacType = Utils::jsonValue<std::string>(stacJson, "type"); |
| 470 | if (stacType == "Feature") |
| 471 | m_p->handleItem(stacJson, m_filename); |
| 472 | else if (stacType == "Catalog") |
| 473 | m_p->handleCatalog(stacJson, m_filename); |
| 474 | else if (stacType == "Collection") |
| 475 | m_p->handleCollection(stacJson, m_filename); |
| 476 | else if (stacType == "FeatureCollection") |
| 477 | m_p->handleItemCollection(stacJson, m_filename); |
| 478 | else |
| 479 | throw pdal_error("Could not initialize STAC object of type " + stacType); |
| 480 | |
| 481 | m_p->m_pool->await(); |
| 482 | m_p->m_pool->stop(); |
| 483 | |
| 484 | if (m_p->m_readerList.empty()) |
| 485 | throwError("Reader list is empty after filtering."); |
| 486 | |
| 487 | setInput(m_p->m_merge); |
| 488 | StageWrapper::initialize(m_p->m_merge); |
| 489 | } |
| 490 | |
| 491 | QuickInfo StacReader::inspect() |
| 492 | { |
nothing calls this directly
no test coverage detected