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

Method inspect

io/CopcReader.cpp:573–617  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

571
572
573QuickInfo CopcReader::inspect()
574{
575 PointTable t;
576 QuickInfo qi;
577
578 initialize(t);
579
580 const las::Header& h = m_p->header;
581 qi.m_bounds = h.bounds;
582 qi.m_srs = getSpatialReference();
583 qi.m_pointCount = h.pointCount();
584
585 PointLayout layout;
586 addDimensions(&layout);
587 for (Dimension::Id dim : layout.dims())
588 qi.m_dimNames.push_back(layout.dimName(dim));
589
590 // If there is a spatial filter from an explicit --bounds, an origin query,
591 // or polygons, then we'll limit our number of points to be an upper bound,
592 // and clip our bounds to the selected region.
593 if (hasSpatialFilter())
594 {
595 loadHierarchy();
596
597 qi.m_pointCount = m_p->hierarchy.pointCount();
598
599 //ABELL - This is wrong since we're not transforming the tile bounds to the
600 // SRS of each clip region, but that seems like a lot of mess for
601 // little value. Wait until someone complains. (Note that's it's a bit
602 // different from queryOverlaps or we'd just call that.)
603 // Clip the resulting bounds to the intersection of:
604 // - the query bounds (from an explicit bounds or an origin query)
605 // - the extents of the polygon selection
606 BOX3D b;
607 b.grow(m_p->clip.box);
608 for (const auto& poly : m_args->polys)
609 b.grow(poly.bounds());
610
611 if (b.valid())
612 qi.m_bounds.clip(b);
613 }
614 qi.m_valid = true;
615
616 return qi;
617}
618
619
620void CopcReader::addDimensions(PointLayoutPtr layout)

Callers

nothing calls this directly

Calls 7

initializeFunction · 0.85
addDimensionsFunction · 0.85
dimNameMethod · 0.80
pointCountMethod · 0.45
growMethod · 0.45
boundsMethod · 0.45
validMethod · 0.45

Tested by

no test coverage detected