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

Method initialize

io/StacReader.cpp:459–489  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

457}
458
459void 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
491QuickInfo StacReader::inspect()
492{

Callers

nothing calls this directly

Calls 12

setInputFunction · 0.85
initializeFunction · 0.85
initializeArgsMethod · 0.80
getJsonMethod · 0.80
handleCatalogMethod · 0.80
handleCollectionMethod · 0.80
handleItemCollectionMethod · 0.80
logFunction · 0.50
resetMethod · 0.45
setLogMethod · 0.45
handleItemMethod · 0.45
emptyMethod · 0.45

Tested by

no test coverage detected