Created
April 2, 2019 05:49
-
-
Save sunapi386/9971ce1152c20ad65b3e54931dbb58b5 to your computer and use it in GitHub Desktop.
C++ LAZ-PERF LAZPERF LAS tool example how to use
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <laz-perf/io.hpp> | |
| #include <laz-perf/las.hpp> | |
| #include <filesystem> | |
| void write_a_fake_laz(const std::string &path) { | |
| const std::filesystem::path &outname (path); | |
| using namespace laszip; | |
| using namespace laszip::formats; | |
| struct point { | |
| las::point10 p; | |
| }; | |
| io::header header{}; | |
| io::writer::config config(header); | |
| factory::record_schema schema; | |
| schema(factory::record_item::point()); | |
| io::writer::file f(outname.string(), schema, config); | |
| point p; | |
| std::cout << "write laz " << outname << "\n"; | |
| for (int i =0; i<70000; i++) { | |
| p.p.x = int(i * 10.0); | |
| p.p.y = int(i * 100.0); | |
| p.p.z = int(i * 1000.0); | |
| f.writePoint((char *)&p); | |
| } | |
| f.close(); | |
| } | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi @sunapi386, thank you very much for the example, but it seems outdated... Would it be possible to have an updated version?