| 42 | using namespace pdal; |
| 43 | |
| 44 | void testOverlay(int numReaders, bool stream) |
| 45 | { |
| 46 | Options ro; |
| 47 | ro.add("filename", Support::datapath("autzen/autzen-dd.las")); |
| 48 | |
| 49 | StageFactory factory; |
| 50 | |
| 51 | Options fo; |
| 52 | fo.add("dimension", "Classification"); |
| 53 | fo.add("column", "cls"); |
| 54 | fo.add("bounds", "([-123.072145, -123.062904],[44.054331, 44.062296])"); |
| 55 | fo.add("datasource", Support::datapath("autzen/attributes.shp")); |
| 56 | |
| 57 | LogPtr l(Log::makeLog("readers.las", "stderr")); |
| 58 | Stage& f = *(factory.createStage("filters.overlay")); |
| 59 | for (int i = 0; i < numReaders; ++i) |
| 60 | { |
| 61 | Stage& r = *(factory.createStage("readers.las")); |
| 62 | r.setLog(l); |
| 63 | r.setOptions(ro); |
| 64 | f.setInput(r); |
| 65 | } |
| 66 | f.setOptions(fo); |
| 67 | |
| 68 | std::string tempfile(Support::temppath("out.las")); |
| 69 | |
| 70 | Options wo; |
| 71 | wo.add("filename", tempfile); |
| 72 | wo.add("forward", "all"); |
| 73 | Stage& w = *(factory.createStage("writers.las")); |
| 74 | w.setInput(f); |
| 75 | w.setOptions(wo); |
| 76 | |
| 77 | FileUtils::deleteFile(tempfile); |
| 78 | if (stream) |
| 79 | { |
| 80 | FixedPointTable t(100); |
| 81 | w.prepare(t); |
| 82 | w.execute(t); |
| 83 | } |
| 84 | else |
| 85 | { |
| 86 | PointTable t; |
| 87 | w.prepare(t); |
| 88 | w.execute(t); |
| 89 | } |
| 90 | // |
| 91 | // |
| 92 | Options testOptions; |
| 93 | testOptions.add("filename", tempfile); |
| 94 | |
| 95 | Stage& test = *(factory.createStage("readers.las")); |
| 96 | test.setOptions(testOptions); |
| 97 | |
| 98 | Stage& c = *(factory.createStage("filters.crop")); |
| 99 | c.setInput(test); |
| 100 | |
| 101 | Options o1; |
no test coverage detected