| 79 | } |
| 80 | |
| 81 | void makeProducer(const std::string& filename) |
| 82 | { |
| 83 | using namespace pdal; |
| 84 | |
| 85 | FixedPointTable t(10000); |
| 86 | |
| 87 | // Prepare the reader |
| 88 | LasReader r; |
| 89 | Options o; |
| 90 | o.add("filename", filename); |
| 91 | r.setOptions(o); |
| 92 | QuickInfo qi = r.preview(); |
| 93 | num_total_points = qi.m_pointCount; |
| 94 | std::cout << "Reading: " << filename << "\n"; |
| 95 | std::cout << "Number of points: " << num_total_points << "\n"; |
| 96 | |
| 97 | // Set the precision for printing points |
| 98 | std::cout.precision(10); |
| 99 | |
| 100 | StreamCallbackFilter f; |
| 101 | f.setCallback(producePoint); |
| 102 | f.setInput(r); |
| 103 | f.prepare(t); |
| 104 | f.execute(t); |
| 105 | } |
| 106 | |
| 107 | int main() |
| 108 | { |