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

Method ready

io/LasReader.cpp:464–514  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

462
463
464void LasReader::ready(PointTableRef table)
465{
466 if (getNumPoints() == 0)
467 return;
468
469 d->pool.resize(d->opts.numThreads);
470 LasStreamPtr lasStream(createStream());
471 std::istream& stream(*lasStream);
472
473 d->currentTile.reset();
474 d->tiles.clear();
475
476 d->index = 0;
477 if (d->header.dataCompressed())
478 {
479 const las::Vlr *vlr = las::findVlr(las::LaszipUserId, las::LaszipRecordId, d->vlrs);
480 if (!vlr)
481 throwError("LAZ file missing required laszip VLR.");
482 lazperf::laz_vlr laz_vlr;
483 laz_vlr.fill(vlr->data(), vlr->dataSize());
484 try
485 {
486 d->chunkInfo.load(stream, d->header.pointOffset, d->header.pointCount(),
487 laz_vlr.chunk_size);
488 }
489 catch (const pdal_error& e)
490 {
491 throwError(e.what());
492 }
493
494 d->nextFetchChunk = 0;
495 d->nextFetchPoint = 0;
496 if (d->opts.start > 0)
497 {
498 if (d->opts.start >= d->header.pointCount())
499 throwError("'start' option set past end of file.");
500 d->nextFetchChunk = d->chunkInfo.chunk(d->opts.start);
501 d->nextFetchPoint = d->chunkInfo.index(d->opts.start, d->nextFetchChunk);
502 }
503 d->nextReadChunk = d->nextFetchChunk;
504 }
505 else
506 {
507 d->nextFetchPoint = d->opts.start;
508 d->nextFetchChunk = 0;
509 d->nextReadChunk = 0;
510 }
511
512 for (int i = 0; i < d->opts.numThreads; ++i)
513 d->queueNext();
514}
515
516void LasReader::queueNextCompressedChunk()
517{

Callers

nothing calls this directly

Calls 14

findVlrFunction · 0.85
resizeMethod · 0.80
dataCompressedMethod · 0.80
dataSizeMethod · 0.80
getNumPointsFunction · 0.70
resetMethod · 0.45
clearMethod · 0.45
fillMethod · 0.45
dataMethod · 0.45
loadMethod · 0.45
pointCountMethod · 0.45
whatMethod · 0.45

Tested by

no test coverage detected